# Telegram

Telegram Bot skill for sending and editing Telegram messages via Bot API.

- Repository: https://github.com/bubbuild/bub (1696 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add bubbuild/bub --skill telegram -g -a claude-code -y`
Codex: `npx skills add bubbuild/bub --skill telegram -g -a codex -y`
Cursor: `npx skills add bubbuild/bub --skill telegram -g -a cursor -y`
Gemini CLI: `npx skills add bubbuild/bub --skill telegram -g -a gemini-cli -y`

## Description

Telegram Bot skill for sending and editing Telegram messages via Bot API. Use when Bub needs to: (1) Send a message to a Telegram user/group/channel, (2) Reply to a specific Telegram message with reply_to_message_id, (3) Edit an existing Telegram message, or (4) Push proactive Telegram notifications. Prefer rich formatted messages (headings, lists, tables, blockquotes, math, collapsible details, captioned media) over plain markdown whenever the content is more than one short paragraph.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Telegram Skill

Agent-facing execution guide for Telegram outbound communication.

Env vars:

- `BUB_TELEGRAM_TOKEN=${config.telegram.token}`

## Required Inputs
Collect these before execution:

- `chat_id` (required)
- `message_id` (required for edit or reply)
- message content (required for send/edit)
- `reply_to_message_id` (required when you need a threaded reply)

## Rich Messages (Bot API 10.1+, June 2026), **PREFERRED**

For any message that benefits from structured formatting, headings, bullet/numbered lists, tables, blockquotes, collapsible `<details>`, captioned media, math blocks, code blocks with language hints, or mixed media, use the dedicated `telegram_rich.py` script with `rich-html-style` markup. This is the **first-choice** path; fall back to plain markdown (`telegram_send.py`) only for short single-paragraph replies.

The Rich Message API uses `sendRichMessage` and `editMessageText` with a `rich_message` payload. Exactly one of `html` or `markdown` must be supplied. Supported HTML tags include `<b>`, `<i>`, `<u>`, `<s>`, `<tg-spoiler>`, `<code>`, `<pre>`, `<mark>`, `<sub>`, `<sup>`, `<h1>`-`<h6>`, `<p>`, `<ul>`/`<ol>`/`<li>`, `<blockquote>`, `<aside>`, `<details>`/`<summary>`, `<table>`, `<figure>`/`<figcaption>`, `<img>`/`<video>`/`<audio>`, `<tg-collage>`, `<tg-slideshow>`, `<tg-map>`, `<tg-math>`, `<tg-math-block>`, `<tg-reference>`, `<tg-emoji>`, `<tg-time>`. Full reference: https://core.telegram.org/bots/api#rich-html-style

```bash
# Send rich message (HTML)
uv run ./scripts/telegram_rich.py \
  --chat-id <CHAT_ID> \
  --html "<h2>Title</h2><p>Body with <b>bold</b> and <code>code</code>.</p>"

# Send rich message (HTML from heredoc via file)
uv run ./scripts/telegram_rich.py \
  --chat-id <CHAT_ID> \
  --html-file /tmp/payload.html \
  --reply-to <MESSAGE_ID>

# Send rich message (Markdown instead of HTML)
uv run ./scripts/telegram_rich.py \
  --chat-id <CHAT_ID> \
  --markdown "## Title\n\n- item one\n- item two"

The rest: https://github.com/bubbuild/bub/blob/HEAD/src/skills/telegram/SKILL.md
