Here is the sequence that worked for me after the battle for several hours:
Suppose the bot name is my_bot .
1- Add the bot to the group.
Go to the group, click on the name of the group, click "Add members", in the search field find your bot, like this: @my_bot, select your bot and click "Add".
2- Send a fictitious message to the bot.
You can use this example: /my_id @my_bot
(I tried several messages, not all messages work. The example above works fine. Perhaps the message should start with /)
3- Go to the following URL: https://api.telegram.org/botXXX:YYYY/getUpdates
replace XXX: YYYY with your bot token
4 Look for "chat": {"id": - zzzzzzzzzz,
-zzzzzzzzzz is your chat id (with a negative sign).
5- Testing:. You can test sending a message to a group using curl:
curl -X POST "https://api.telegram.org/botXXX:YYYY/sendMessage" -d "chat_id=-zzzzzzzzzz&text=my sample text"
If you skip step 2, you wonโt find updates for the group. In addition, if there are several groups, you can search for the group name in the response ("title": " group_name ").
Hope this helps.
apadana Jul 15 '16 at 6:01 2016-07-15 06:01
source share