Skip to content

Telegram Bot API 10.1#325

Merged
ayrat555 merged 3 commits into
masterfrom
ayrat555/bot-api-10.1
Jun 20, 2026
Merged

Telegram Bot API 10.1#325
ayrat555 merged 3 commits into
masterfrom
ayrat555/bot-api-10.1

Conversation

@ayrat555

Copy link
Copy Markdown
Owner

resolves #324

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_message module implementing Rich Message objects (blocks/text), and wired it into core Message/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 media link, and editMessageText rich 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 EdJoPaTo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread src/rich_message.rs Outdated
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),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why are these renames here? Why not name them directly that way? 🤔

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

@ayrat555 ayrat555 merged commit 0e924b8 into master Jun 20, 2026
64 checks passed
@ayrat555 ayrat555 deleted the ayrat555/bot-api-10.1 branch June 20, 2026 12:39
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.

Bot api update ( 10.1 )

3 participants