Telegram integration

Get a message in Telegram when your feedback needs attention. Voxtrics posts to Telegram from an alert: a rule that watches incoming responses, for example "at least 3 ratings of 2 or lower within an hour". Messages come from a Telegram bot of your own, sent to a chat you choose: a group, a channel or your personal chat with the bot. Voxtrics needs one address that holds both, the bot's token and the chat's id.

Create a bot

  1. In Telegram, open @BotFather and send /newbot.
  2. Give the bot a name, for example Voxtrics alerts, and a username ending in bot.
  3. BotFather replies with the bot's token, which looks like 123456789:AAHf0x.... Copy it.

Add the bot to the chat

  • A group: add the bot as a member.
  • A channel: add the bot as an administrator allowed to post messages.
  • Your personal chat: open the bot and press Start. A bot can't write to anyone who hasn't started it.

Then send any message in that chat, so Telegram has something to show in the next step.

Find the chat's id

  1. Open this address in your browser, with your token in place of YOUR_TOKEN:

    https://api.telegram.org/botYOUR_TOKEN/getUpdates
    
  2. Find "chat":{"id": in the answer and copy the number after it. A group's or a channel's id starts with a minus, for example -1001234567890: keep the minus.

If the answer is empty ("result":[]), send another message in the chat and reload the page: Telegram keeps these updates for 24 hours only.

Send alerts to Telegram

  1. Put the token and the chat's id into this address:

    https://api.telegram.org/botYOUR_TOKEN/sendMessage?chat_id=YOUR_CHAT_ID
    
  2. Go to Alerts and click New alert, or the pencil icon (Edit) on an existing rule.

  3. Set the rule's name, scope, time window and condition, as described in Alerts.

  4. Under Notify via, select Telegram and paste the address into Telegram Webhook URL.

  5. Click Create alert, or Save changes for an existing rule.

The address posts only to the chat it names. To get the same alerts in another chat too, build an address for that chat and add it to the rule with Add Telegram chat. Several rules can use the same address.

What the message says

Each time the rule fires, the chat gets a short text message with the rule's name, the domain, how many responses in the time window matched and why the rule fired. The responses themselves aren't in it: open the firing in Alerts to see them.

A rule fires at most once every 30 minutes, or less often if you set a throttle. A space's alerts post at most 200 messages a day to Telegram and Slack together. Past that a rule still fires and the firing shows in Alerts, but nothing is posted.

If messages don't arrive

  • If the alert isn't saved, check that the address starts with https://api.telegram.org/. Voxtrics accepts only Telegram's own Bot API address, not a t.me link to a chat or a bot.
  • Check that the rule is enabled and has fired: every firing is listed in Alerts.
  • If the rule fired but nothing reached Telegram, check that the bot is still in the chat (and an administrator in a channel), that the chat's id kept its minus, and that the token hasn't been revoked. A group that Telegram turned into a supergroup gets a new id: find it again and update the address.