/telegram-skills:tg-rich-digestfrom telegram-skills
Composes daily or weekly digests, community summaries, newsletters, or channel articles and sends them as structured Telegram rich messages via bot. Covers flat and preview+collapsed layouts, media evidence, and a preflight gate before publishing.
Ships in telegram-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Send a digest or report as a single structured Telegram Rich Message (Bot API 10.2) — section headings, topic lists, collapsible long-tail, photo collage, map embed, and a footer — all in one document-grade message.
This skill covers the digest/report pattern specifically. For block types and sending see ../tg-rich-messages/SKILL.md. To convert an existing Markdown report see ../tg-markdown-to-rich/SKILL.md.
Recommended block sequence:
[heading h2] — digest title + date range
[paragraph] — 1–3 sentence lead: what happened, key number
[heading h3] — topic 1
[list] — 3–7 bullet items for topic 1
[heading h3] — topic 2
[list] — ...
[details] — "All links / Full list" — long-tail, closed by default
[divider] — visual separator before footer
[collage] — photo report (optional)
[map] — event location (optional)
[footer] — date, source, issue number
Each element below is shown as HTML markup, the string placed inside
InputRichMessage.html. Bot API 10.2 also accepts InputRichMessage.blocks for code-built
documents.
Note: When you receive the message back,
Message.rich_messagecontains the parsedRichBlockJSON (e.g.{"type": "heading", ...}). That structure is receive-only — you cannot send it.
The anatomy above is the flat layout: everything visible, <details> reserved for the
long tail. It works for a short digest — a handful of bullets a reader scans in the feed.
It stops working once the digest becomes an article. A long rich message in a channel is rendered collapsed anyway, but Telegram decides where to cut, and the cut usually lands mid-sentence in the middle of your third section. The fix is to make the cut yourself:
[heading h1] — the claim, as a headline
[paragraph] — 2-3 short paragraphs: the fact, your own check, the consequence
[photo] — cover image
[details] — "Read the full version" — the ENTIRE article, closed by default
Everything below the lead lives inside one <details> block: sections, media, sources,
sign-off. The reader sees a deliberate preview and one button; the feed shows a clean card
instead of an arbitrary truncation.
<h1>Voice model ships with Russian audio-to-audio</h1>
<p>The vendor shipped <code>voice-think-fast-2.0</code> on July 29. First audio in 0.7 s, $0.08 per minute.</p>
<p>We tested Russian audio-to-audio: the model heard the question and answered <b>323</b>.</p>
<img src="tg://photo?id=cover"/>
<details><summary>Read the full version</summary>
<h2>What shipped</h2>
...
</details>
Budget the preview. Roughly 500 visible characters total before <details>, with no
single paragraph over ~220 — past that the feed truncates the preview itself and the whole
point is lost. Count visible characters, not markup.
Two rules that are easy to get wrong:
<details> counts as part of the preview. One cover image, no more.<details>. Anything after the closing tag reads as a
detached fragment in the feed.| Digest shape | Layout |
|---|---|
| Bullet roundup, under ~1500 chars | Flat — <details> for the long tail only |
| Article with sections, media, sources | Preview + full version in one <details> |
<h2>Weekly Digest — Jun 9–15</h2>
<h1>–<h6> map to heading sizes 1–6. Use <h2> for the digest title, <h3> for topic sections.
<p>This week the community hit <b>1,200 members</b>. Three tools shipped, one hot thread ran 80+ replies.</p>
<h3>Top Discussions</h3>
<ul>
<li><a href="https://example.com/thread/42">LLM context limits — practical patterns</a> — 81 replies</li>
<li><a href="https://example.com/thread/55">Prompt caching deep dive</a> — 80% cost reduction reported</li>
</ul>
For ordered lists use <ol> with optional start, type ("1", "a", "A", "i", "I"), and reversed attributes on <ol>, or value on individual <li>.
Use <details> for content most readers skip: full link lists, raw stats, appendices. Omit open to collapse by default.
<details><summary>All links this week (9)</summary>
<ol>
<li><a href="https://example.com/thread/42">LLM context limits — practical patterns</a></li>
<li><a href="https://example.com/thread/55">Prompt caching deep dive</a></li>
<li><a href="https://github.com/example/promptkit">promptkit v0.4 release notes</a></li>
</ol>
</details>
Add open attribute (<details open>) only for critical content that should be visible by default.
<hr/>
Collages, slideshows and maps: see Media Patterns.
<footer>AI Builders Community — Issue #24 — Week of June 9–15, 2026</footer>
Media can use public HTTP/HTTPS URLs directly. Existing Telegram file_id values and new
multipart uploads use explicit Bot API 10.2 media bindings:
{
"html": "<h2>Daily</h2><img src=\"tg://photo?id=cover\"/>",
"media": [
{"id": "cover", "media": {"type": "photo", "media": "AgAC...file_id"}}
]
}
For a new upload, set media to attach://cover_file, send multipart/form-data, and attach
the binary under the cover_file part name.
A collage at the end of a digest is a photo report. A screenshot placed directly under the claim it supports is evidence, and it is what makes a digest worth more than the links it cites. In the preview + full version layout the body carries the media:
<h2>What shipped</h2>
<p>The release notes list the model as generally available.</p>
<img src="tg://photo?id=release_source"/>
<h2>Our test</h2>
<p>We asked it in Russian. It answered correctly.</p>
<audio src="tg://audio?id=live_answer"></audio>
Rules that hold up in practice:
duration, performer, title for audio) — see
../tg-rich-messages/SKILL.md.editMessageText with its message_id)
rather than with a follow-up post that splits the artifact.Group multiple photos (and optionally videos) into a single tile layout. Use <figure> with <figcaption> and <cite> for attribution.
<tg-collage>
<figure>
<img src="https://example.com/photos/meetup-1.jpg"/>
<figcaption>Photos from the June meetup<cite>Photo: @photographer_handle</cite></figcaption>
</figure>
<img src="https://example.com/photos/meetup-2.jpg"/>
<video src="https://example.com/videos/highlight.mp4"></video>
</tg-collage>
Mix <img> and <video> freely inside <tg-collage>.
Use <tg-slideshow> when order matters (tutorial steps, before/after, event sequence):
<tg-slideshow>
<figure><img src="https://example.com/slides/step-1.jpg"/><figcaption>Step 1: initial setup</figcaption></figure>
<figure><img src="https://example.com/slides/step-2.jpg"/><figcaption>Step 2: configure</figcaption></figure>
</tg-slideshow>
Wrap a collage in <details> when photos are supplemental and should not dominate the digest on first glance:
<details><summary>Expand to see photo report (6 photos)</summary>
<tg-collage>
<figure><img src="https://example.com/photos/meetup-berlin-1.jpg"/><figcaption>Community meetup — Berlin — 2026-06-10</figcaption></figure>
<img src="https://example.com/photos/meetup-berlin-2.jpg"/>
<img src="https://example.com/photos/meetup-berlin-3.jpg"/>
</tg-collage>
</details>
One static location tile, no interactive markers. zoom is optional, 0–24.
<tg-map lat="52.5200" long="13.4050" zoom="15"/>
| Limit | Value |
|---|---|
| Max UTF-8 characters (incl. alt-text, formulas) | 32 768 |
| Max blocks (all nested: list items, table rows, details content, quotation blocks) | 500 |
| Max nesting levels | 16 |
Max media attachments in total, direct URLs and tg:// references alike | 50 |
| Max table columns | 20 |
In the preview + full version layout the preview budget from Layout choice is the one that actually binds. The API limits above are generous; the feed card is not.
Every items entry in a list counts as one block. Every blocks entry inside details counts. Nested list items each count individually. A collage with 8 photos = 1 (collage) + 8 (photo) = 9 blocks.
When a digest is near limits, cut in this order:
"Continued →" footer; open part 2 with a heading "(continued)".Pre-calculate the block count before sending: count blocks recursively, including list items, table rows and blocks inside details and quotations. RichText fragments inside a block are not blocks.
A digest published on a schedule needs a check that runs without taste. Everything below is mechanically verifiable, and each one has a failure mode that readers see the moment the post is live:
| Check | Why |
|---|---|
| Preview under the visible-character budget | Otherwise the feed truncates the preview itself |
Preview + full version: exactly one closed <details>, sign-off inside it. Flat digest: <details> optional | A trailing fragment after the closing tag |
Every tg://photo, tg://video, tg://document, tg://audio reference with an id bound, every binding referenced | Silent missing media, or a renamed id |
Every attach:// name present in the manifest, file on disk | Send fails at upload time |
Blank line before --- | Markdown reads the rule as a heading underline and turns the paragraph above it into an <h2> |
Bare @handle only for Telegram usernames | Telegram links any @word as a Telegram user; external handles must be full URLs |
| Every outbound link resolves | Readers hit the 404 before you fix it with editMessageText |
| Not a duplicate of a previous edition | Scheduled pipelines re-publish on retry |
Run it as a script with a non-zero exit code, before the send, on every edition. Splitting the report into blocking and fixable keeps it usable: a dead link blocks, a long paragraph is a warning.
Use sendRichMessage. Supply exactly one of html, markdown, or blocks inside
InputRichMessage.
Minimal call (raw HTTP):
curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendRichMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "@your_channel",
"rich_message": {
"markdown": "## Weekly Digest\n\nLead paragraph.\n\n### Top Topics\n\n- Item one\n- Item two\n\n---\n\n<footer>Issue #1 · 2026-06-15</footer>"
}
}'
For a private chat or group pass the numeric chat_id instead. The bot must have permission to send the relevant media types if the digest includes photos or video.
Rich Message rendering on older Telegram clients is not documented by Telegram. Before sending to your full audience:
sendRichMessage to a single private chat or a staging channel.../tg-rich-messages/SKILL.md — block types, media bindings, sending../tg-markdown-to-rich/SKILL.md — convert existing Markdown into a rich message../../reference/rich-messages-spec.md — Rich Message API reference, including every RichText typeWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
telegram-bot, rich-messages, digest, newsletter, community-summary
15 skills in this plugin
/tg-bot-opsUse when running a Telegram bot in production: webhook or long polling, allowed_updates, webhook secret token, bot settings from code (setMySettings, getMe, privacy mode, callback_query_mode), botinvite links, 429 and retry_after, file retries, broadcast limits and paid broadcasts, lost updates on shutdown, a poison update after new Bot API types, t.me outage and fallback domains, local Bot API server./tg-capability-mapUse before promising a Telegram feature or designing around one: what a bot can do in Bot API, what lives only in the client or MTProto (scheduled posts, channel stats, poll stats, channel stories, folders, boosts, welcome messages, communities), and what never to promise from a bot./tg-npx claudepluginhub serejaris/telegram-skills --plugin telegram-skillsOther plugins' skills for the same job