Telegram Bot - how to get a group chat id?

后端 未结 12 1112
北海茫月
北海茫月 2020-11-30 16:42

I\'ve been using telegram_bot, and trying to get groupChat id to send notifications to group chat, but don\'t know which methods I have to use for it.

For getting ch

12条回答
  •  孤独总比滥情好
    2020-11-30 17:23

    As of March 2020, simply:

    • Invite @RawDataBot to your group.

    Upon joining it will output a JSON file where your chat id will be located at message.chat.id.

    "message": {
        "chat": {
            "id": -210987654,
            "title": ...,
            "type": "group",
            ...
        }
        ...
    }
    

    Be sure to kick @RawDataBot from your group afterwards.

提交回复
热议问题