At the moment, the only way to restrict bots to one channel only is to manually remove the bot's chat permissions in each channel that you don't want it in.
From the top-right hand corner of the chat window, select the bot's profile image. Locate and select the “Add to Group” option below the “Send Message” option to access a list of groups to add members to. Select the group you wish to add the bot to. Click on “Yes” to confirm.
Open Top.gg listing of the bot you would like to add to your Discord server and tap the red 'Invite' button. If you have not logged in to Discord on your web browser yet, sign in using your login credentials on the next page.
Now all clients allow to do it, but it's not pretty simple.
In any Telegram client:
Administrators
This is how I've added a bot to my channel and set up notifications:
telegram.me/whateverIWantAndAvailable
the channel id will be @whateverIWantAndAvailable
Now set up your bot to send notifications by pusshing the messages here:
https://api.telegram.org/botTOKENOFTHEBOT/sendMessage?chat_id=@whateverIWantAndAvailable&text=Test
the message which bot will notify is: Test
I strongly suggest an urlencode of the message like
https://api.telegram.org/botTOKENOFTHEBOT/sendMessage?chat_id=@whateverIWantAndAvailable&text=Testing%20if%20this%20works
in php you can use urlencode("Test if this works"); in js you can encodeURIComponent("Test if this works");
I hope it helps
As of now:
To add the bot to your channel:
click on the channel name:
click on admins:
click on Add Admin:
search for your bot like @your_bot_name, and click add:**
* In some platforms like mac native telegram client it may look like that you can add bot as a member, but at the end it won't work.
** the bot doesn't need to be in your contact list.
Are you using the right chat_id and including your bot's token after "bot" in the address? (api.telegram.org/bottoken/sendMessage)
This page explains a few things about sending (down in "sendMessage" section) - basic stuff, but I often forget the basics.
To quote:
In order to use the sendMessage method we need to use the proper chat_id.
First things first let's send the /start command to our bot via a Telegram client.
After sent this command let's perform a getUpdates commands.
curl -s \
-X POST \ https://api.telegram.org/bot<token>/getUpdates \ | jq .
The response will be like the following
{ "result": [
{
"message": {
"text": "/start",
"date": 1435176541,
"chat": {
"username": "yourusername",
"first_name": "yourfirstname",
"id": 65535
},
"from": {
"username": "yourusername",
"first_name": "yourfirstname",
"id": 65535
},
"message_id": 1
},
"update_id": 714636917
} ], "ok": true }
We are interested in the property result.message[0].chat.id, save this information elsewhere.
Please note that this is only an example, you may want to set up some automatism to handle those informations Now how we can send a message ? It's simple let's check out this snippet.
curl -s \
-X POST \ https://api.telegram.org/bot<token>/sendMessage \
-d text="A message from your bot" \
-d chat_id=65535 \ | jq .
Where chat_id is the piece of information saved before.
I hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With