Skip to content

feat: add Telegram rich message support#118

Merged
sudoskys merged 9 commits into
mainfrom
feat/rich-message-support
Jun 13, 2026
Merged

feat: add Telegram rich message support#118
sudoskys merged 9 commits into
mainfrom
feat/rich-message-support

Conversation

@sudoskys

@sudoskys sudoskys commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a Bot API 10.1 Rich Message backend via richify() and InputRichMessage
  • add a living Rich Message PRD plus project control-plane docs and ADR automation
  • preserve current MessageEntity fields when splitting/clipping and add date_time serialization support
  • add CI entries for Rich Message unit tests and live sendRichMessage contract validation when Telegram secrets are configured
  • add playground/rich_message_case.py for manual Rich Message showcase sends from playground/t_longtext.md

Verification

  • pdm run test-rich -> 15 tests OK
  • pdm run test-live-rich -> 1 test OK against the real Telegram Bot API; Telegram returned Message.rich_message
  • pdm run python playground/rich_message_case.py -> sent playground/t_longtext.md as a real Rich Message, message_id 69, block_count 35
  • pdm run test -> 218 tests OK, 1 skipped
  • make adr-lint -> OK (0 ADRs)
  • make adr-index -> regenerated docs/adr/ACTIVE.md
  • pdm build -> sdist and wheel built successfully

Compatibility

  • convert() remains tuple[str, list[MessageEntity]]
  • richify() is a parallel output backend, not a replacement for entity output
  • core runtime dependency remains pyromark only; PyYAML is in the tests optional group for ADR tooling

Notes

  • Rich Message PRs now require pdm run test-live-rich with TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID before PR creation.

sudoskys added 9 commits May 14, 2026 16:35
…R-001)

Add telegramify_rich() delivery pipeline and split_rich() splitter.
The walker tracks top-level block depth and emits RichBlock fragments;
the splitter bins them by byte (32768) and block count (500) budgets.

Live-verified block counting rule: top-level elements only, internal
children (li, tr, nested p/lists) do not add to the count.
@sudoskys sudoskys merged commit ab7d573 into main Jun 13, 2026
4 checks 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.

1 participant