> ## Documentation Index
> Fetch the complete documentation index at: https://snapr.seshuk.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram

> Send job run results to a Telegram chat, group, or channel through a bot after each snapr job run.

`type: telegram` sends a message through the [Telegram Bot API](https://core.telegram.org/bots/api).

## Options

| Option     | Type       | Required | Default | Description                                                  |
| ---------- | ---------- | -------- | ------- | ------------------------------------------------------------ |
| `type`     | `telegram` | Yes      | —       |                                                              |
| `botToken` | string     | Yes      | —       | Token from [@BotFather](https://t.me/BotFather). Use `env:`. |
| `chatId`   | string     | Yes      | —       | Numeric chat ID (negative for groups).                       |

Plus the [common fields](/configuration/notifiers/overview) (`name`, `onSuccess`, `onFailure`).

## Set up a bot

<Steps>
  <Step title="Create the bot">
    Open [@BotFather](https://t.me/BotFather) in Telegram, send `/newbot`, and follow the prompts. BotFather replies with the bot token — store it in an environment variable and reference it with `env:`.
  </Step>

  <Step title="Add the bot to the chat">
    For a group or channel, add the bot as a member first. The bot cannot post to a chat it is not in.
  </Step>

  <Step title="Find the chat ID">
    Send any message in the target chat, then open `https://api.telegram.org/bot<TOKEN>/getUpdates` in a browser. The `chat.id` field in the response is your chat ID. Group IDs are negative numbers.
  </Step>
</Steps>

## Example

```yaml snapr.yaml theme={null}
notifiers:
  - type: telegram
    name: oncall
    botToken: env:TG_BOT_TOKEN
    chatId: '-1001234567890'
    onFailure: true
```

<Note>Quote the `chatId` value. Group IDs start with `-`, and YAML would otherwise parse the value as a number.</Note>
