Skip to content

Instantly share code, notes, and snippets.

@Phazz
Last active January 30, 2019 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phazz/58d316bb0eda0777a6d2b549487468cd to your computer and use it in GitHub Desktop.
Save Phazz/58d316bb0eda0777a6d2b549487468cd to your computer and use it in GitHub Desktop.

Links

Available Methods

Setup your bot to send messages to a channel

  1. Open https://telegram.me/botfather, create a bot and get a <Bot_token>
  2. Go to your bot and launch it using /start
  3. Add your bot as an admin to the desired chat
  4. Send a test message to your bot from the channel use @bot_name
  5. Get updates received by your bot: https://api.telegram.org/bot<Bot_token>/getUpdates
  6. Get the chat_id from the response of step 4 result.$.message.chat.id, it starts with a -
  7. Send a message to a channel through your bot: https://api.telegram.org/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment