Skip to main content

Create a Telegram bot

  1. Open BotFather in Telegram and send /newbot.
  2. Follow the instructions to name your bot and choose its username.
  3. Copy the bot token that BotFather provides. Keep it private; anyone with the token can control your bot.

Find your chat ID

  1. Open your new bot in Telegram and send /start.
  2. Open https://api.telegram.org/bot<TOKEN>/getUpdates, replacing <TOKEN> with your bot token.
  3. In the response, copy the value of result[0].message.chat.id.
If result is empty, send another message to your bot and reload the URL.

Add Telegram to Midway

Run the Midway setup command and paste the bot token and chat ID when prompted:
By default, Midway sends notifications to all configured methods. To restrict delivery, define notification.send_to and include Telegram; configured methods left out of the list will not receive notifications. With pick_from: All, Midway sends through every method listed there:
pick_from can further select a subset of the methods in send_to for each notification. You can also add them directly to midway.yaml under tokens.telegram: