Skip to content

Instantly share code, notes, and snippets.

@zhum
Created September 3, 2021 11:38
Show Gist options
  • Save zhum/af61a7b675bd62be8bf07af3ae75febe to your computer and use it in GitHub Desktop.
Save zhum/af61a7b675bd62be8bf07af3ae75febe to your computer and use it in GitHub Desktop.
Как получить telegram id группы, если есть бот
  1. Добавить бота в нужную группу;
  2. Написать хотя бы одно сообщение в неё;
  3. Отправить GET-запрос: curl https://api.telegram.org/bot<YourBOTToken>/getUpdates
  4. Взять значение "id" из объекта "chat". Это и есть идентификатор чата. Для групповых чатов он отрицательный, для личных переписок положительный.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment