← ClaudeAtlas

tg-markdown-to-richlisted

Use when converting Markdown documents, reports, or any text content into a Telegram Rich Message for delivery via a bot. Triggers: "send markdown to Telegram", "convert doc to rich message", "publish report to bot", "format markdown for sendRichMessage", "telegram rich message from file". Produces an InputRichMessage JSON object ready for Telegram Bot API 10.2 sendRichMessage, including file_id, URL, and multipart upload media bindings.
serejaris/telegram-skills · ★ 41 · Data & Documents · score 87
Install: claude install-skill serejaris/telegram-skills
# tg-markdown-to-rich The converter uses Python 3 standard library only. Direct sending requires network access to `api.telegram.org` and `TELEGRAM_BOT_TOKEN`. Converts a Markdown file (or stdin) into a Telegram `InputRichMessage` JSON object. The output uses the `markdown` field of `InputRichMessage` and is ready to pass directly to [`sendRichMessage`](../../reference/rich-messages-spec.md). See also: [`../tg-rich-messages/SKILL.md`](../tg-rich-messages/SKILL.md) for composing rich messages programmatically. --- ## Usage ```bash # File input → stdout JSON python3 scripts/md2rich.py document.md # Pipe stdin cat report.md | python3 scripts/md2rich.py # Additional flags python3 scripts/md2rich.py document.md --rtl python3 scripts/md2rich.py document.md --skip-entity-detection python3 scripts/md2rich.py document.md \ --media cover=photo=AgAC...file_id \ --media voice=voice_note=https://cdn.example.com/briefing.ogg # Bindings with player metadata (duration, performer, title, has_spoiler) python3 scripts/md2rich.py document.md --media-json bindings.json # Upload local files: each attach://NAME needs a matching --attach NAME=PATH python3 scripts/md2rich.py document.md \ --media-json bindings.json \ --attach cover_file=./cover.png \ --attach answer_file=./answer.mp3 # Send directly via Telegram Bot API (multipart when --attach is used) TELEGRAM_BOT_TOKEN=<token> python3 scripts/md2rich.py document.md \ --send --chat-id <chat_id> ``` `--media` covers the commo