Telegram¶
Telegram is a messaging app; DRACO sends messages through your own bot to a group, channel or private chat.
- What DRACO uses: Nothing: DRACO's messages are sent by your own Telegram bot to a group, channel or private chat.
- What for: Messages from workflows, approval and task requests, alert and SLA notifications.
Add it in Connectors > Add connector: pick Telegram, then choose what DRACO may send. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.
Parts¶
| Part | What DRACO uses | Access | Permissions |
|---|---|---|---|
| Notifications | Send message (Telegram) | write | A bot token from @BotFather, saved as a Token credential (vendor telegram): the token is the secret (anyone with it can act as the bot). The bot is a member of the group, or in a channel an administrator with Post messages. |
Requirements¶
- Any Telegram account: a bot is free and needs no paid plan.
- In a group, someone who may add members; in a channel, an administrator.
- Telegram only receives: DRACO reads no messages from it.
Notifications¶
The Send message (Telegram) response action (telegram_send_message) sends a message from your bot to one chat: a group, a supergroup (also one of its topics), a channel, or a private chat with one person. A message can carry an Open button: workflows, approval requests and SLA notifications use it for the link to the incident or to the task.
Client setup (in Telegram)¶
- In Telegram open a chat with @BotFather, the official bot that creates bots.
- Send
/newbot, then a name (for exampleDRACO alerts) and a username that ends inbot(for exampleacme_draco_bot). - Copy the token BotFather replies with (
123456789:AA...). Keep it secret: anyone with it controls the bot. - Add the bot to the chat:
- Group: open the group info > Add members and add the bot.
- Channel: Administrators > Add Admin, pick the bot and keep Post messages on.
- Private chat with one person: that person opens the bot and presses Start (bots cannot write first).
- Find the chat id: open the chat in Telegram Web (
web.telegram.org/a); the number after#in the address is the chat id. Groups and channels start with-100. A public channel can use its@usernameinstead.
Add it in DRACO¶
- Connectors > Add connector, pick Telegram and tick Notifications under Responders.
- Write access: a Token credential (vendor
telegram) with the bot token. You can create it in the wizard. - Settings: the Chat id. Optional: the message text, the Button link (an
https://link becomes the Open button; another link is added to the text), a Topic id for a group with topics, and Send silently. - Test: DRACO signs in as the bot (
getMe), reads the chat (getChat) and the bot's membership in it (getChatMember), and names what is missing (the bot not in the group, or not allowed to post in the channel). The test sends nothing.
One action posts to one chat. For several chats, add one action each with the same credential.
Where it is used¶
- Workflows: an action step, and the Also post to list of approval and form steps (the request carries an Open link to the task). The communication templates take a Telegram action in their channel slot.
- Alerts and notifications: the channels of an On connector health rule (Notifications).
- SLA: the messaging actions of the SLA policy.
The text is a template: {{ incident.title }}, {{ incident.severity }}, {{ incident.url }}, {{ target.value }} and similar fields are filled in. A message is at most 4,096 characters; a longer one is cut. Its result holds the message id for later steps.
Security¶
The bot token is part of every Telegram API address. DRACO keeps it encrypted in the credential and never shows it: previews show bot{token}, and errors and logs replace it with <token>.
If the token leaks, send /revoke to @BotFather, pick the bot, and Rotate the credential in DRACO with the new token. Bot tokens do not expire otherwise.
Troubleshooting¶
| The test or a run says | Fix |
|---|---|
| Telegram refused the bot token (401) | The token is wrong or was revoked: copy it again from @BotFather (/mybots > the bot > API Token) and rotate the credential. |
| Telegram has no chat ... the bot can see | Add the bot to the group or channel, or ask the person to press Start in a private chat with the bot; check the chat id (groups and channels start with -100). |
| The bot may not post to ... | Add the bot to the chat; in a channel make it an administrator with Post messages; in a group check that members may send messages. |
| The group ... became a supergroup | Telegram gave the group a new id when it became a supergroup: enter the id the message names. |
| Telegram has no topic ... | The Topic id does not exist in that group: leave it empty or pick the topic's id. |
| Telegram rate limit reached | Telegram allows a bot about 20 messages a minute in one group; the execution is retried after the wait Telegram asks for. |
Not covered yet¶
- Reading messages or replies from Telegram (DRACO only sends).
- Approving a request with a button inside Telegram: the Open button opens the task in DRACO, where you sign in and decide.