Skip to main content

Telegram

Send release notifications to Telegram

Config

announce:
  telegram:
    enabled: true
    bot_token: "{{ Env.TELEGRAM_TOKEN }}"
    chat_id: "-100123456789"
    parse_mode: "MarkdownV2"
    message_template: "{{ ProjectName }} {{ Tag }} has been released!"

Create a Telegram bot via @BotFather and add it to the target group or channel. The chat_id is the numeric ID of the group or channel (prefix with -100 for supergroups/channels), or a public channel username like @mychannel.

Parse mode

The optional parse_mode field controls how Telegram renders the message text. Supported values:

  • MarkdownV2 (the default) -- Telegram-flavored Markdown. Pass every dynamic value through the mdv2escape filter and backslash-escape literal !, ., - and the other reserved characters, as the default template does.
  • HTML -- a subset of HTML tags (<b>, <i>, <a>, <code>, <pre>).

Environment variables

Store the bot token in an environment variable so it stays out of your committed config file. When bot_token is unset, anodizer falls back to the TELEGRAM_TOKEN env var:

announce:
  telegram:
    bot_token: "{{ Env.TELEGRAM_TOKEN }}"
FieldTypeDescription
enabledbool or templateEnable Telegram notifications
bot_tokenstringTelegram Bot API token (falls back to TELEGRAM_TOKEN)
chat_idstringTarget chat, group, or channel ID
parse_modestringMarkdownV2 or HTML. Default: MarkdownV2
message_templatestringMessage body (templates supported). Default: `{{ ProjectName
message_thread_idstringTopic (thread) to post in inside a forum group (templates supported; must render an integer)