Ermöglicht es einem Agenten, Telegram-Nachrichten mit reichhaltiger HTML- oder Markdown-Formatierung zu senden, zu bearbeiten und darauf zu antworten.
- GitHub Stars
- 1.703
- Dateien
- 4
- Letzter Commit
- 11. Nov. 2026
- Lizenz
- Apache-2.0
- Erlaubte Tools
- —
Was macht der telegram Skill?
Ermöglicht es einem Agenten, Telegram-Nachrichten mit reichhaltiger HTML- oder Markdown-Formatierung zu senden, zu bearbeiten und darauf zu antworten.
Zusammenfassung erzeugt aus der SKILL.md des Skills.
Über den telegram skill
Diese Skill ermöglicht es KI-Agenten, mit Nutzern, Gruppen oder Kanälen via Telegram zu kommunizieren. Ein Agent kann neue Nachrichten senden, auf spezifische bestehende Nachrichten antworten, bereits gesendete Inhalte bearbeiten oder proaktive Benachrichtigungen verschicken. Entwickler können dies nutzen, um die ausgehende Kommunikation über die Telegram Bot API zu steuern, sodass Agenten aktiv in einem Gespräch bleiben können, ohne auf einen Prompt zu warten.
Wenn ein Agent strukturierte Informationen wie Tabellen, Mathe-Blöcke oder einklappbare Details liefern muss, sollte er das Skript telegram_rich.py laden, um reichhaltige HTML- oder Markdown-Formatierung zu nutzen. Für einfache Antworten in einem einzelnen Absatz dient das Skript telegram_send.py als Fallback. Die Skill benötigt einen Telegram Bot Token und spezifische Identifikatoren wie chat_id und message_id, um zu funktionieren. Sie ist für komplexe Szenarien ausgelegt, wie etwa die Kommunikation mit anderen Bots in einer Gruppe oder das Bereitstellen von Echtzeit-Fortschritts-Updates durch das Bearbeiten einer einzelnen Nachricht, während sich eine Aufgabe entwickelt.
Was ein agent damit machen kann
- 1Strukturierte Berichte sendenEin Agent kann komplexe Daten unter Verwendung von HTML-Tags für Überschriften, Listen und Tabellen liefern.
- 2Echtzeit-Task-Updates bereitstellenEin Agent kann einen Nutzer über seinen Fortschritt informieren, indem er eine einzige Nachricht aktualisiert, anstatt mehrere neue zu senden.
- 3Mit anderen Bots interagierenIn einer Gruppenumgebung kann ein Agent absichtlich einen anderen Bot durch spezifische Mention-Muster triggern.
- 4Sprachnachrichten verarbeitenDer Agent kann eingehende Audiodaten verarbeiten, indem er sie transkribiert, bevor er eine Antwort generiert.
Geschrieben basierend auf dem SKILL.md des skills. Jeder use case wurde gegen ein zitat daraus geprüft.
So installierst du den telegram Skill
Jeder Befehl kopiert den Skill-Ordner in das Skills-Verzeichnis des Clients. Starte den Client neu oder beginne eine neue Session, um ihn zu laden.Den telegram Skill in Claude Code installieren
~/.claude/skills/telegram/SKILL.md
$ npx degit bubbuild/bub/src/skills/telegram ~/.claude/skills/telegramDen telegram Skill in Claude Code (project) installieren
.claude/skills/telegram/SKILL.md
$ npx degit bubbuild/bub/src/skills/telegram .claude/skills/telegramDen telegram Skill in Codex installieren
~/.agents/skills/telegram/SKILL.md
$ npx degit bubbuild/bub/src/skills/telegram ~/.agents/skills/telegramDen telegram Skill in Gemini CLI installieren
~/.gemini/skills/telegram/SKILL.md
$ npx degit bubbuild/bub/src/skills/telegram ~/.gemini/skills/telegramDen telegram Skill in Claude.ai installieren
npx degit bubbuild/bub/src/skills/telegram telegram && zip -r telegram.zip telegram # claude.ai → Customize → Skills → + → Create skill → Upload a skill → telegram.zip
Automatisierte Checks
Geluften am 15. Nov. 2026Vollständiger Bericht →Hat unsere automatischen Prüfungen bestanden. Das ist kein Sicherheitsaudit: Lesen Sie die Skripte, bevor ein Agent sie ausführt. Wie die Checks funktionieren
- Source Repository verknüpft und erreichbarbubbuild/bub/src/skills/telegram is public and reachablegithub.com/bubbuild/bub/tree/HEAD/src/skills/telegram ↗Bestanden
- Open Source Lizenz (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Bestanden
- Commit oder Release im letzten JahrLast commit 2026-11-11github.com/bubbuild/bub/commits ↗Bestanden
- Keine Download-und-Ausführen-Muster oder Zugangsdatendiebstahl in Skripten3 scripts read; no download-and-run, remote eval, base64 execution or credential uploadBestanden
- Keine versteckten Anweisungen in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/bubbuild/bub/blob/HEAD/src/skills/telegram/SKILL. ↗Bestanden
- Vorab erlaubte Tools sind eingeschränktNo pre-approved tools; the agent asks before using onegithub.com/bubbuild/bub/blob/HEAD/src/skills/telegram/SKILL. ↗Bestanden
- SKILL.md folgt dem Agent-Skills-FormatValid name and description; says when to use it; 185 linesgithub.com/bubbuild/bub/blob/HEAD/src/skills/telegram/SKILL. ↗Bestanden
SKILL.md
Auf GitHub ansehenTelegram 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
# 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
- If handling a direct user message in Telegram and
message_idis known, send a reply message (--reply-to). - 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-idto mention viatg://user?id=link. - For long-running tasks, optionally send one progress message, then edit that same message for final status.
- 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. - Prefer
telegram_rich.py(rich-html-style) overtelegram_send.pyfor 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:
- Reply directly to the other bot's message when
message_idis available. - Use an explicit command mention such as
/command@OtherBotwhen you need to invoke that bot intentionally. - 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:
- Send a short acknowledgment reply
- Continue processing
- If blocked, edit or send an issue update immediately
- Edit the acknowledgment message with final result when possible
Voice Message Policy
When the inbound Telegram message is voice:
- Transcribe the voice input first (use STT skill if available)
- Prepare response content based on transcription
- Prefer voice response output (use TTS skill if available)
- 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.
# 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@usernamestyle mention when set--source-user-id: optional, usestg://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:
- Reply directly to the other bot's message when
message_idis available. - Use an explicit command mention such as
/command@OtherBotwhen you need to invoke that bot intentionally. - Do not assume free-form group text will reach another bot.
Dateien in diesem Skill
4telegram Skill-Fragen
Wie installiere ich den telegram Skill in Claude Code?
Führe npx degit bubbuild/bub/src/skills/telegram ~/.claude/skills/telegram aus. Claude Code lädt Skills aus ~/.claude/skills (alle Projekte) oder .claude/skills (ein Projekt) und nutzt einen Skill, wenn seine Beschreibung zur Aufgabe passt.
Welche Clients können den telegram Skill nutzen?
Jeder Client, der das Agent Skills-Format liest: Claude Code, Codex, Gemini CLI und claude.ai (als ZIP hochladen). Skripte im Skill laufen nur dort, wo der Client Codeausführung erlaubt.
Wie sollte ich lange oder strukturierte Nachrichten senden?
Verwende das Skript telegram_rich.py mit rich-html-style Markup für Überschriften, Listen, Tabellen und andere strukturierte Elemente.
Was ist der beste Weg, um Sonderzeichen im Nachrichteninhalt zu handhaben?
Übergib den Nachrichteninhalt immer via stdin über einen heredoc pipe, um Shell-Escaping-Fehler bei Zeichen wie Anführungszeichen oder Dollarzeichen zu vermeiden.
Wie kann ein Agent mit einem anderen Bot in einer Gruppe kommunizieren?
Antworte direkt auf die Nachricht des anderen Bots oder verwende eine explizite Command-Erwähnung wie /command@OtherBot.