Help / Alerts
Telegram
A Telegram channel sends alerts as messages from a Telegram bot to a chat or group. You make the bot yourself, so the alerts come from a bot only you control.
What you need first
- A Telegram account.
- About five minutes to make a bot and find the chat ID.
You will end up with two things: the bot's token and the chat ID. HonkWatch needs both, joined by a | sign.
Make a bot and get its token
Telegram's own guide is at core.telegram.org/bots/features.
- In Telegram, open a chat with @BotFather, Telegram's official bot for making bots.
- Send
/newbotand answer the questions: a display name, then a username ending in "bot". - BotFather replies with a token that looks like
123456:ABC-DEF.... Copy it.
Keep the token private. Anyone who has it can send messages as your bot.
Find the chat ID
- Decide where alerts should go.
- Just you: open a chat with your new bot and send it any message, such as "hello".
- A group: add the bot to the group, then send any message in the group.
- In a web browser, open
https://api.telegram.org/botTOKEN/getUpdates, with your token in place of TOKEN. - In the text that appears, find
"chat":and the"id"just after it. That number is the chat ID. Group IDs start with a minus sign; keep it.
If the page shows an empty list, send the bot another message and reload the page. More detail is in Telegram's Bot API documentation.
Add it in HonkWatch
- Open Alerts and go to Add a channel.
- Under Where should alerts go?, choose Telegram.
- In Send to, enter the token, a
|sign, then the chat ID, with no spaces. For example:123456:ABC-DEF|987654321. - If you like, fill in Label (optional), such as "Ops group".
- Tick the events to send: Down, Back up, Certificate expiring and Slow.
- Press Add channel. The list shows the channel as "chat" followed by the chat ID.
Send a test
- In the channel list on Alerts, press Send test on the Telegram row.
- Your bot should send a message about "Test monitor" to the chat shortly.
What an alert looks like
Each alert is a plain text message from your bot. The first line is the service name in square brackets, then the monitor and what happened, for example "Shop is DOWN". Below it are the monitor's address, the reason and a link to the monitor's page.
If it does not work
- Recently sent shows failed. Telegram refused the message. Check these in order:
- The token is complete and correct. Copy it again from BotFather.
- The chat ID is correct, including the minus sign for a group.
- You sent the bot a message first. A bot cannot start a chat with a person on its own.
- For a group, the bot is still a member and is allowed to post.
- There is exactly one
|between the token and the chat ID.
- The details were wrong. A channel cannot be edited. Add a new Telegram channel with the right details, test it, then press Remove on the old one.
See also Setting up alerts for which events go where.
Still stuck? Email [email protected] and say which guide you were following.