skip to Main Content

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.

2

Answers


  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.

    Login or Signup to reply.
  2. Yes they do, bot tokens are in that format – BOT_ID:SOME_STUFF, in here BOT_ID is your bot’s id.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search