telegram poster

Telegram Chat ID

Assume the bot name is test_bot.
Replace test_bot with the bot name in the sequence below:

  1. Add the bot to the group.
    Go to the group, click on group name, click on Add members, in the search box search for your bot like this: @test_bot, select your bot and click add.
  2. Send a message to the bot.
    Use this example: /my_id @test_bot
  3. Go to following url: https://api.telegram.org/botXXX:YYYY/getUpdates
    replace XXX:YYYY with your bot token. Remember the text ‘bot’ before the token.
  4. Look for “chat”:{“id”:-zzzzzzzzzz,
    -zzzzzzzzzz is the Chat ID (including the negative sign).
    Or find the User ID “from”:{“id”:zzzzzzzzzz,   Use this for direct messages to the user.
  5. Testing: You can test sending a message to the group with a curl:

curl -X POST “https://api.telegram.org/botXXX:YYYY/sendMessage” -d “chat_id=-zzzzzzzzzz&text=TEST TEXT”

If you miss step 2, there would be no update for the group you are looking for.
If there are multiple groups, look for the group name in the response (“title”:”group_name”).
If it doesn’t work, delete the bot from the group and add it again. This often happens when you added the bot at group creation.