'Do bots have their own Chat IDs?

Do bots have chat_id like user accounts? Where can I find it? I want to use it to send messages to my bot using pyrogram.



Solution 1:[1]

Chat IDs are the same for everyone that accesses that chat. In private messages (1-to-1 chats), chat_id == user_id.

Two Examples:

  • The chat_id of @PyrogramChat is -1001387666944, no matter who accesses or retrieves it.
  • @PyrogramBot has the user_id 483849041, to send it a message you can use that ID as the chat_id.

As for how to send messages, see the Documentation.

Solution 2:[2]

Yes they do, bot tokens are in that format - BOT_ID:SOME_STUFF, in here BOT_ID is your bot's id.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ColinShark
Solution 2 Abdurahmon