tg-markdown-to-richlisted
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