Skip to content

feat: add optional Telegram rich Markdown output - #80

Merged
TerrifiedBug merged 2 commits into
masterfrom
feat/rich-messages
Sep 19, 2026
Merged

TerrifiedBug merged 2 commits into
masterfrom
feat/rich-messages

Conversation

@TerrifiedBug

@TerrifiedBug TerrifiedBug commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Closes #79.

Adds optional rich Markdown output on Bot API 10.1+. MarkdownV2 stays the default.

  • /telegram set richMessages off keeps MarkdownV2. auto selects rich output for tables, task lists, details, paired dollar math, and custom emoji tags outside code. on prefers rich output for all Markdown.
  • Rich requests carry the original Markdown. Literal format: "text" sends bypass rich formatting.
  • Live drafts and group previews keep their existing transports. Final messages and preview edits use the selected format without replaying committed text.
  • With no explicit chunk cap or permanent preview, an eligible answer up to 32768 UTF-16 source units can arrive as one rich message. An explicit textChunkLimit still wins. Longer answers and existing previews keep labeled legacy-sized chunks.
  • Definitive rich rejections (400/404) fall back to MarkdownV2, then plain text on a parse rejection. A rejected whole answer is re-split before legacy sends. Ambiguous transport failures, server errors, authorization failures, and exhausted rate limits never trigger an alternate-format send. Missing-topic recovery and 429 retries keep their existing behavior.

Verification

Bun 1.3.14: bun run check passed typechecking and all 369 tests. Focused coverage includes reload behavior, literal/code exclusions, safe fallback of a 6000-character report, reply/topic routing, rate limits, Unicode reconstruction, fence repair, and preview finalization without duplicate content.

An isolated smoke driver exercised the issue's report fixture, ordinary bold text, literal text, and a DM draft followed by one persistent rich answer. Telegram fetches were intercepted with a dummy token; no real messages were sent. The driver was removed afterward.

Live verification

The maintainer tested rich messages locally, confirmed they work, and approved merging and closing #79. Telegram controls native rendering and checkbox interaction; the bridge adds no checklist-management workflow or state store.

Branched directly from master at 96db014. This does not include or repair #78; that PR remains separate and unmerged.

@TerrifiedBug
TerrifiedBug marked this pull request as ready for review September 19, 2026 00:08
@TerrifiedBug
TerrifiedBug merged commit bd1edac into master Sep 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Telegram Rich Markdown / sendRichMessage for outbound formatting

1 participant