← ClaudeAtlas

tg-widgetslisted

Use when building or sending a Telegram message widget (HTML bubble, HTMLBubbles, `sendWidget`, `messageMediaWidget`, Bot API 10.4): an interactive HTML, CSS and JS program inside a chat bubble, such as a game, poll, calculator or live ticker. Teaches everything needed to write one: size, bubble, input, sandbox rules, state and requests, sending, and which chats accept a widget in production. Not for Mini Apps or Rich Messages.
serejaris/telegram-skills · ★ 41 · AI & Automation · score 87
Install: claude install-skill serejaris/telegram-skills
# tg-widgets A widget is one self-contained HTML document with inline CSS and JS. A bot sends it as a message, and it runs in the chat bubble with no window, no server and no network. The HTML never changes after sending; only the bot changes the widget's state. Everything needed to write a widget is below. The rules follow Telegram's [`widget-sandbox`](https://github.com/TelegramMessenger/widget-sandbox) documentation, v0.6.0, checked on 2026-11-06. Bot API 10.4 (2026-11-09) made widgets official: the methods and the delivery rules are on [core.telegram.org/bots/widgets](https://core.telegram.org/bots/widgets), and where that page and the repository disagree, the page wins. For a detail not covered here, see `docs/sdk-v1.md` and `docs/profile-v1.md` in that repository. ## Steps 1. Write the widget by the rules below. 2. Measure as the server does: ```bash python3 scripts/widget_tool.py check widget.html ``` 3. Send it to your private chat with the bot. The tool sends once and never retries: after a timeout the message may already be delivered. ```bash TELEGRAM_BOT_TOKEN=... python3 scripts/widget_tool.py send widget.html --chat CHAT_ID --caption "Tap the water to feed" ``` 4. Open it on a phone. A successful `sendWidget` proves only that the server accepted it: clients below layer 233 show an unsupported-media stub with the caption, so write a caption that makes sense alone. ## Size The server compresses the HTML with zlib level 9 and refuses anyt