Created
March 15, 2020 21:03
-
-
Save sansal54/7bf565a30059b0f2053a3b3fa8bc1977 to your computer and use it in GitHub Desktop.
Get chat id from Telegram bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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