Skip to content

Instantly share code, notes, and snippets.

@sansal54
Created March 15, 2020 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sansal54/7bf565a30059b0f2053a3b3fa8bc1977 to your computer and use it in GitHub Desktop.
Save sansal54/7bf565a30059b0f2053a3b3fa8bc1977 to your computer and use it in GitHub Desktop.
Get chat id from Telegram bot
Get chat id from Telegram bot
1- Add the bot to the group.
Go to the group, click on group name, click on Add members, in the searchbox search for your bot like this: @my_bot, select your bot and click add.
2- Send a dummy message to the bot.
You can use this example: /my_id @my_bot
(I tried a few messages, not all the messages work. The example above works fine. Maybe the message should start with /)
3- Go to 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 the negative sign).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment