Repository navigation
Bot API 10.4: widgets - #2654
Closed
Brian-1812 wants to merge 3 commits into
Closed
Brian-1812 wants to merge 3 commits into
Brian-1812 wants to merge 3 commits into
Conversation
Add the widget part of Bot API 10.4: - types Widget, WidgetQuery, SharedWidgetQuery, WidgetQueryType (data, sign_data, sent_transaction), WidgetQueryWallet, InputWidgetMessageContent and InputSharedWidgetMessageContent; - TonWalletCard, TonWalletCardSticker, TonNft and TonNftAttribute, because WidgetQueryTypeData.wallet_card uses them; - Message.widget, ExternalReplyInfo.widget, Update.widget_query and Update.shared_widget_query; - send_widget, send_shared_widget, answer_widget_query, edit_message_widget_data and edit_shared_widget_data, sync and async; - widget_query_handler and shared_widget_query_handler, sync and async. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- types: each :param description is on one line, like the other classes; - answer_widget_query: use the API method names, as in the API text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
One PR should be enough. |
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.
Description
Adds the "Widgets" part of Bot API 10.4. The other 10.4 sections are in a second PR on top of this one, so each review stays small.
Widget,WidgetQuery,SharedWidgetQuery,WidgetQueryType(data,sign_data,sent_transaction),WidgetQueryWallet,InputWidgetMessageContent,InputSharedWidgetMessageContent.TonWalletCard,TonWalletCardSticker,TonNft,TonNftAttribute, becauseWidgetQueryTypeData.wallet_carduses them.StoryAreaPositioncan now be parsed, because the sticker position uses it.Message.widget,ExternalReplyInfo.widget,Update.widget_query,Update.shared_widget_query.send_widget,send_shared_widget,answer_widget_query,edit_message_widget_data,edit_shared_widget_data.widget_query_handler,shared_widget_query_handler.Closes #2653
Describe your tests
New unit tests parse JSON shaped like the docs, check the request payloads and send both update types to their handlers. An empty
public_datais sent, because the API uses it to remove the data.cd tests && py.test: 330 passed, 73 skipped. I also ran every new method against a local fake Bot API server. I did not test against the live API.Python version: 3.12.2
OS: macOS 26.1
Checklist:
🤖 Generated with Claude Code