Telegram Bot API 10.1#325
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the crate to support Telegram Bot API 10.1 (per issue #324), primarily by adding Rich Message schema support plus the new API methods/fields introduced in the June 11, 2026 update.
Changes:
- Added a new
rich_messagemodule implementing Rich Message objects (blocks/text), and wired it into coreMessage/serialization tests. - Added new API methods to both sync/async traits:
sendRichMessage,sendRichMessageDraft,answerChatJoinRequestQuery,sendChatJoinRequestWebApp. - Extended existing types/method params for new Bot API 10.1 fields (e.g.,
guard_bot,supports_join_request_queries, poll medialink, andeditMessageTextrich message support).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.rs | Adds new Bot API 10.1 fields, Rich Message attachment on Message, poll media Link, and serde tests. |
| src/trait_sync.rs | Exposes new Bot API 10.1 methods on the sync TelegramApi trait. |
| src/trait_async.rs | Exposes new Bot API 10.1 methods on the async AsyncTelegramApi trait. |
| src/rich_message.rs | Introduces Rich Message types (blocks/text objects) for serialize/deserialize and request payloads. |
| src/methods.rs | Adds params structs for new methods and extends EditMessageTextParams to support Rich Messages. |
| src/lib.rs | Exports the new rich_message module. |
| src/input_media.rs | Adds link media support for poll option media (InputMediaLink). |
| src/inline_mode.rs | Adds Rich Message support as an InputMessageContent variant for inline mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EdJoPaTo
reviewed
Jun 15, 2026
EdJoPaTo
left a comment
Collaborator
There was a problem hiding this comment.
The API additions are usually quite annoying to review with all their fine details, so I only glanced over it. Looks mostly good, just a minor question.
Comment on lines
+263
to
+275
| #[serde(rename = "heading")] | ||
| SectionHeading(RichBlockSectionHeading), | ||
| #[serde(rename = "pre")] | ||
| Preformatted(RichBlockPreformatted), | ||
| Footer(RichBlockFooter), | ||
| Divider(RichBlockDivider), | ||
| MathematicalExpression(RichBlockMathematicalExpression), | ||
| Anchor(RichBlockAnchor), | ||
| List(RichBlockList), | ||
| #[serde(rename = "blockquote")] | ||
| BlockQuotation(RichBlockBlockQuotation), | ||
| #[serde(rename = "pullquote")] | ||
| PullQuotation(RichBlockPullQuotation), |
Collaborator
There was a problem hiding this comment.
Out of curiosity, why are these renames here? Why not name them directly that way? 🤔
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #324