1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-06-22 11:15:11 +00:00

Add Bot API 10.1 Rich Messages support

Adds the full Rich Messages type system and methods:
- RichText hierarchy: RichTextPlain, RichTextGroup, RichTextEntity and all
  24 RichText* entity types, with a recursive serializer handling plain
  strings, arrays and typed objects
- RichBlock hierarchy: all 21 RichBlock* types plus RichBlockCaption,
  RichBlockTableCell and RichBlockListItem (JsonContentPolymorphic by type)
- RichMessage type and RichMessageContent message content; rich_message
  parsed in RawMessage; RichMessageContentMessage typealias
- InputRichMessage (internal constructor + InputRichMessageHTML /
  InputRichMessageMarkdown factories) and InputRichMessageContent usable as
  InputMessageContent
- SendRichMessage and SendRichMessageDraft requests with API bindings
- richMessage parameter on EditChatMessageText
- Serialization round-trip test for RichMessage/RichText/RichBlock

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 17:32:56 +06:00
parent f6d5b3ea71
commit 6bdd217530
25 changed files with 4130 additions and 2 deletions

View File

@@ -5,6 +5,12 @@
**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026)**
* `Core`:
* (`Rich Messages`) Added `RichText` (`RichTextPlain`, `RichTextGroup`, `RichTextEntity`) hierarchy with all 24 `RichText*` entity types and a recursive serializer supporting plain strings, arrays and typed objects
* (`Rich Messages`) Added `RichBlock` hierarchy with all 21 `RichBlock*` types plus `RichBlockCaption`, `RichBlockTableCell` and `RichBlockListItem`
* (`Rich Messages`) Added `RichMessage` type and `RichMessageContent` message content; parsed `rich_message` in `RawMessage`; added `RichMessageContentMessage` typealias
* (`Rich Messages`) Added `InputRichMessage` (internal constructor with `InputRichMessageHTML`/`InputRichMessageMarkdown` factories) and `InputRichMessageContent` usable as `InputMessageContent`
* (`Rich Messages`) Added `SendRichMessage` and `SendRichMessageDraft` requests
* (`Rich Messages`) Added `richMessage` parameter to `EditChatMessageText`
* (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option
* (`Polls`) Added `link` field parsing to `PollMedia` deserialization/serialization
* (`Polls`) Added `TelegramMediaLink` (`InputMediaLink`) implementing `InputPollOptionMedia`, usable as a poll option media
@@ -14,6 +20,7 @@
* (`Join Request Queries`) Added `AnswerChatJoinRequestQuery` request and `ChatJoinRequestQueryResult` enum (`Approve`/`Decline`/`Queue`)
* (`Join Request Queries`) Added `SendChatJoinRequestWebApp` request
* `API`:
* (`Rich Messages`) Added `sendRichMessage` and `sendRichMessageDraft` `TelegramBot` extensions
* (`Join Request Queries`) Added `answerChatJoinRequestQuery` and `sendChatJoinRequestWebApp` `TelegramBot` extensions
* `Utils`:
* (`Join Request Queries`) Added `ChatJoinRequest.query_id` raw accessor