feat: add Bot API 10.1 rich messages support#284
Closed
nathan77886 wants to merge 2 commits into
Closed
Conversation
…messages feat: add Bot API 10.1 rich messages support
Contributor
|
Спасибо за вклад! Закрываю в пользу #283, который реализует ту же фичу (Bot API 10.1 Rich Messages). #283 ближе следует конвенциям репозитория (именование полей union-типов как в reaction.go), дополнительно покрывает параметр rich_message в editMessageText и имеет более полные тесты. Влито в main (74a6bed). |
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.
Summary
This PR adds Telegram Bot API 10.1 Rich Messages support.
The main goal is to support rich message content in inline query results, especially this use case:
InlineQueryResultArticlein inline query resultstitle,description, andthumbnail_urlin the inline candidate listurlfieldWhat changed
InputRichMessageContentsupport for inline queryinput_message_contentMessage.rich_messagesupportWhy
Telegram Bot API 10.1 introduced Rich Messages, which allow bots to send structured rich content. This is especially useful for inline query scenarios where the result list should show an article-style preview, while the selected result sends rich content containing text and media.
Without this support, users need to either:
InlineQueryResultPhoto, which does not reliably show title/description in some Telegram clientsInlineQueryResultArticlewith plain text content onlyanswerInlineQueryThis PR makes Rich Message support available through the typed Go API.
Compatibility
This change is intended to be additive and should not break existing inline query result types or existing
InputMessageContentimplementations.Existing types such as:
InputTextMessageContentInlineQueryResultArticleInlineQueryResultPhotoInlineQueryResultCachedPhotoshould continue to work as before.
Testing
I ran:
Please see the latest CI result for full validation.