Agent skill

Telegram

by bubbuild in bubbuild/bub

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

Apache-2.0Auto-check passedProductivity & Automation

Install Telegram

skills CLI
$ npx skills add bubbuild/bub --skill telegram -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bubbuild/bub telegram --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bubbuild/bub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/telegram .claude/skills/telegram && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
telegram
GitHub stars
1.7k
Token cost
~2.2k tokens
SKILL.md length
825 words
Files
4 (incl. scripts)
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

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

  • Works in 5 steps: If handling a direct user message in… → If source metadata says sender is a bot… → For long-running tasks, optionally send… → …
  • Send a message to a Telegram user/group/channel
  • SKILL.md covers Required Inputs, Rich Messages (Bot API 10.1+,…, Execution Policy and Bot to co-Bot Communication, plus 5 more sections
  • Runs Python scripts from its folder; calls uv; needs BUB_TELEGRAM_TOKEN

What it does

Telegram is an agent skill from bubbuild/bub. 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 replytomessageid, (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.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/telegram_edit.py`, `scripts/telegram_rich.py` and `scripts/telegram_send.py`).

It sits in Productivity & Automation, covering Chatbots and conversational support. It works with Telegram and Python. The repository describes itself as: Bub it. Build it. A tiny agent runtime, composable with plugins. The licence is Apache-2.0.

When your agent uses it

  • Send a message to a Telegram user/group/channel
  • Reply to a specific Telegram message with replytomessageid
  • Edit an existing Telegram message
  • Push proactive Telegram notifications

Example prompts

  • “/telegram”

Requirements

  • Python 3
  • A credential in BUB_TELEGRAM_TOKEN

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. If handling a direct user message in Telegram and message_id is known, send a reply message (--reply-to).
  2. If source metadata says sender is a bot (sender_is_bot=true), do not use reply mode, but send a normal message and prefix content with @…
  3. For long-running tasks, optionally send one progress message, then edit that same message for final status.
  4. ALWAYS pass message content via stdin using heredoc pipe and --message - (or --text -). NEVER embed message text directly in shell…
  5. Prefer telegram_rich.py (rich-html-style) over telegram_send.py for anything beyond a single short paragraph. See the "Rich Messages"…

What it can do on your machine

Read from SKILL.md and the folder at commit b4a61bf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • core.telegram.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • BUB_TELEGRAM_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Telegram loads about 2.2k tokens when it runs. Until then it costs about 125 tokens; SKILL.md has 825 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~125
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from bubbuild/bub at commit b4a61bf, republished under its Apache-2.0 licence (© bubbuild). 825 words, ~2,234 tokens.

Download SKILL.mdSave it as .claude/skills/telegram/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
telegram
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.
metadata.channel
telegram

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"

# Edit an existing message to become a rich message
uv run ./scripts/telegram_rich.py \
  --chat-id <CHAT_ID> \
  --edit <MESSAGE_ID> \
  --html "<p>Updated content.</p>"

For multi-line rich HTML, prefer --html-file over passing the payload on the command line to avoid shell escaping pitfalls. The script reads the file as UTF-8 and strips a single trailing newline.

Execution Policy

  1. If handling a direct user message in Telegram and message_id is known, send a reply message (--reply-to).
  2. If source metadata says sender is a bot (sender_is_bot=true), do not use reply mode, but send a normal message and prefix content with @<sender_username> (or the provided source username). If the user doesn't have a username, use --source-user-id to mention via tg://user?id= link.
  3. For long-running tasks, optionally send one progress message, then edit that same message for final status.
  4. ALWAYS pass message content via stdin using heredoc pipe and --message - (or --text -). NEVER embed message text directly in shell arguments — special characters like ', ", $, ! will be mangled or cause syntax errors.
  5. Prefer telegram_rich.py (rich-html-style) over telegram_send.py for anything beyond a single short paragraph. See the "Rich Messages" section above.

Bot to co-Bot Communication

In Telegram groups, communicate with another bot using only these patterns:

  1. Reply directly to the other bot's message when message_id is available.
  2. Use an explicit command mention such as /command@OtherBot when you need to invoke that bot intentionally.
  3. Do not assume free-form group text will reach another bot.

Active Response Policy

When this skill is in scope, prefer proactive and timely Telegram updates:

  • Send an immediate acknowledgment for newly assigned tasks
  • Send progress updates for long-running operations using message edits
  • Send completion notifications when work finishes
  • Send important status or failure notifications without waiting for follow-up prompts
  • If execution is blocked or fails, send a problem report immediately with cause, impact, and next action

Recommended pattern:

  1. Send a short acknowledgment reply
  2. Continue processing
  3. If blocked, edit or send an issue update immediately
  4. Edit the acknowledgment message with final result when possible
Show full SKILL.md (356 more words)Show less

Voice Message Policy

When the inbound Telegram message is voice:

  1. Transcribe the voice input first (use STT skill if available)
  2. Prepare response content based on transcription
  3. Prefer voice response output (use TTS skill if available)
  4. If voice output is unavailable, send a concise text fallback and state limitation

Reaction Policy

When an inbound Telegram message warrants acknowledgment but does not merit a full reply, use a Telegram reaction as the response. But when any explanation or details are needed, use a normal reply instead.

Command Templates

Paths are relative to this skill directory.

bash
# Send message (ALWAYS use heredoc stdin, never inline text in arguments)
cat << 'EOF' | uv run ${SKILL_DIR}/scripts/telegram_send.py --chat-id <CHAT_ID> --token "$BUB_TELEGRAM_TOKEN" --message -
Your message content here.
Special characters are safe: $100, "quotes", 'apostrophes', !exclamation
EOF

# Reply to a specific message
cat << 'EOF' | uv run ${SKILL_DIR}/scripts/telegram_send.py --chat-id <CHAT_ID> --token "$BUB_TELEGRAM_TOKEN" --reply-to <MESSAGE_ID> --message -
Reply content here.
EOF

# Source message sender is bot: no direct reply, use @username style
cat << 'EOF' | uv run ${SKILL_DIR}/scripts/telegram_send.py --chat-id <CHAT_ID> --token "$BUB_TELEGRAM_TOKEN" --source-is-bot --source-username <USERNAME> --message -
Message to a bot using @username mention.
EOF

# Source message sender is bot without username: use tg://user?id= link
cat << 'EOF' | uv run ${SKILL_DIR}/scripts/telegram_send.py --chat-id <CHAT_ID> --token "$BUB_TELEGRAM_TOKEN" --source-is-bot --source-user-id <USER_ID> --source-display-name "Display Name" --message -
Message to a user/bot using tg://user?id= mention.
EOF

# Edit an existing message
cat << 'EOF' | uv run ${SKILL_DIR}/scripts/telegram_edit.py --chat-id <CHAT_ID> --token "$BUB_TELEGRAM_TOKEN" --message-id <MESSAGE_ID> --text -
Updated content here.
EOF

When sending message to a bot, either use --reply-to argument or pass --source-is-bot with --source-username otherwise the bot will not receive the message.

For other actions that not covered by these scripts, use curl to call Telegram Bot API directly with the provided token.

Script Interface Reference

telegram_rich.py (preferred for structured messages)
  • --chat-id, -c: required
  • --html: rich message content as HTML
  • --html-file: read rich message HTML from a file (preferred for multi-line payloads)
  • --markdown: rich message content as Markdown
  • --markdown-file: read rich message Markdown from a file
  • --rtl: render right-to-left
  • --skip-entity-detection: skip URL/email/mention auto-detection
  • --reply-to, -r: optional message ID to reply to
  • --disable-notification: send silently
  • --edit MESSAGE_ID: edit an existing message instead of sending
  • --token, -t: optional (normally not needed)
telegram_send.py
  • --chat-id, -c: required, supports comma-separated ids
  • --message, -m: required (use - to read from stdin)
  • --reply-to, -r: optional
  • --token, -t: optional (normally not needed)
  • --source-is-bot: optional flag, disables reply mode and adds mention prefix
  • --source-username: optional, uses @username style mention when set
  • --source-user-id: optional, uses tg://user?id= link mention when username is not available
  • --source-display-name: optional, display name for user ID mention (defaults to "User")
telegram_edit.py
  • --chat-id, -c: required
  • --message-id, -m: required
  • --text, -t: required (use - to read from stdin)
  • --token: optional (normally not needed)
Bot to co-Bot Communication

In Telegram groups, communicate with another bot using only these patterns:

  1. Reply directly to the other bot's message when message_id is available.
  2. Use an explicit command mention such as /command@OtherBot when you need to invoke that bot intentionally.
  3. Do not assume free-form group text will reach another bot.

© bubbuild, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in src/skills/telegram of bubbuild/bub.

  • SKILL.md
  • scripts/telegram_edit.py
  • scripts/telegram_rich.py
  • scripts/telegram_send.py

Open the folder on GitHubat commit b4a61bf

Compare with similar skills

Telegram next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Telegram compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Telegram this skillbubbuild/bub1.7k—~2.2kAutomated safety check: PassApache-2.0
Pytdbotpytdbot/client137—~4.3kAutomated safety check: PassMIT
Setupterranc/claude-telegram-bot-bridge134—~1.5kAutomated safety check: NotesNone
Telegram Bot Builderaiskillstore/marketplace4303 repos~2.2kAutomated safety check: NotesNone
Process Inboxtelegramdesktop/tdesktop33k2 repos~4.5kAutomated safety check: PassGPL-3.0
MuseKevPH2026/muse-catch128—~1.6kAutomated safety check: NotesAGPL-3.0

Similar skills

  • Pytdbot

    pytdbot/client

    Write Telegram bots and userbots with Pytdbot (async TDLib wrapper with high-level helpers; not the Telegram Bot API).

    137 GitHub stars~4.3k tokensUpdated 9 days ago
    Productivity & AutomationAuto-check passed
  • Setup

    terranc/claude-telegram-bot-bridge

    Install and configure the Telegram Skill Bot. An agent skill from terranc/claude-telegram-bot-bridge.

    134 GitHub stars~1.5k tokensUpdated 4 mo ago
    Productivity & AutomationAuto-check: notes
  • Telegram Bot Builder

    aiskillstore/marketplace

    Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots.

    430 GitHub starsUsed in 3 repos~2.2k tokens
    Productivity & AutomationAuto-check: notes
  • Process Inbox

    telegramdesktop/tdesktop

    Process the local ignored ai-tdesktop inbox into durable, independently testable Telegram Desktop task records while task execution worktrees remain active.

    33k GitHub starsUsed in 2 repos~4.5k tokens
    Productivity & AutomationAuto-check passed
  • Muse

    KevPH2026/muse-catch

    Muse · Catch — AI 灵感捕手。浏览器插件 + 任意 Agent(Telegram/WhatsApp/Discord…)一键捕获灵感,AI自动提炼,Web Dashboard浏览。分级LLM路由:Agent内置LLM隐私分析 + TokenRouter云端分布式调用。当用户说「灵感」「捕获」「Muse」「Catch」「记下来」「收藏」「稍后读」时自动触发。

    128 GitHub stars~1.6k tokensUpdated 1 mo ago
    Productivity & AutomationAuto-check: notes
  • Telegram Development Guide

    2025Emma/vibe-coding-cn

    Chinese-language guide to building on Telegram: bots through the Bot API, Mini Apps in JavaScript and custom clients through TDLib, with Python examples.

    23k GitHub starsUsed in 1 repo~3.7k tokens
    Backend & APIsAuto-check passed

More from bubbuild/bub

  • Gh

    bubbuild/bub

    GitHub CLI skill for interacting with GitHub via the gh command line tool.

    1.7k GitHub stars~798 tokensUpdated today
    Auto-check passed

Works with

Questions about Telegram

What does Telegram do?

Telegram Bot skill for sending and editing Telegram messages via Bot API. Telegram is an agent skill from bubbuild/bub. Telegram Bot skill for sending and editing Telegram messages via Bot API.

When should I use Telegram?

Telegram fits situations like: send a message to a Telegram user/group/channel; reply to a specific Telegram message with replytomessageid; edit an existing Telegram message; push proactive Telegram notifications.

How do I install Telegram in Claude Code?

Run `npx skills add bubbuild/bub --skill telegram -a claude-code`. Or copy the skill folder (src/skills/telegram in bubbuild/bub) into .claude/skills/telegram in your project. Claude Code loads it when a task matches its description.

How do I install Telegram in Codex?

Run `npx skills add bubbuild/bub --skill telegram -a codex`. Or copy the skill folder (src/skills/telegram in bubbuild/bub) into .agents/skills/telegram in your project. Codex loads it when a task matches its description.

Can I use Telegram in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bubbuild/bub --skill telegram -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/telegram, .gemini/skills/telegram, .github/skills/telegram and .opencode/skills/telegram in your project.

What does Telegram need to run?

Going by SKILL.md and its folder, Telegram needs Python for the scripts in its folder, the command-line tools its instructions call (uv) and credentials named BUB_TELEGRAM_TOKEN. Our summary lists: Python 3; A credential in BUB_TELEGRAM_TOKEN.

Does Telegram access the network?

SKILL.md names 1 domain. As links in the text: core.telegram.org. This is read from the text; nothing was executed.

Is Telegram safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Telegram use?

Telegram is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Telegram use?

About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Telegram?

Skills that share tags, products or a category with Telegram: Pytdbot (pytdbot/client, 137 stars), Setup (terranc/claude-telegram-bot-bridge, 134 stars), Telegram Bot Builder (aiskillstore/marketplace, 430 stars) and Process Inbox (telegramdesktop/tdesktop, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Telegram?

bubbuild (a GitHub organization) maintains it in bubbuild/bub, which has 1,679 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 7, 2026.

Source: bubbuild/bub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.