Skip to content

Instantly share code, notes, and snippets.

@goose-ws
Last active February 17, 2023 17:41
Show Gist options
  • Save goose-ws/1c82c98ac4701af433eb5c7562109e51 to your computer and use it in GitHub Desktop.
Save goose-ws/1c82c98ac4701af433eb5c7562109e51 to your computer and use it in GitHub Desktop.
Get Telegram Channel ID

Originally written by mraaroncruz at https://gist.github.com/mraaroncruz/e76d19f7d61d59419002db54030ebe35
Copied for the sake of archiving

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

New improved next steps

  1. Go to https://web.telegram.org
  2. Click on your channel
  3. Look at the URL and find the part that looks like c12112121212_17878787878787878
  4. Remove the underscore and after c12112121212
  5. Remove the prefixed letter 12112121212
  6. Prefix with a -100 so -10012112121212
  7. That's your channel id.

Old yucky next steps

  1. Make your channel public
  2. Create a public link
  3. Send a message from console to @[your_public_link_text]
  4. Copy chat id from response in console as the channel id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment