Repository navigation
feat: support join request queries from Bot API 10.1 - #323
Merged
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
==========================================
+ Coverage 63.16% 63.18% +0.02%
==========================================
Files 40 40
Lines 3404 3412 +8
==========================================
+ Hits 2150 2156 +6
- Misses 1195 1197 +2
Partials 59 59 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3 tasks done
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.
Closes #322
Adds the Join Request Queries part of Bot API 10.1, which #283 didn't cover:
ChatJoinRequest.QueryIDChatFullInfo.GuardBotUser.SupportsJoinRequestQueriesAnswerChatJoinRequestQueryandSendChatJoinRequestWebAppresultgets amodels.ChatJoinRequestQueryResulttype withapprove,declineandqueueconstants, likeParseMode. It isn't validated, so a value Telegram adds later can still be passed.Also fixes the tag of
User.SupportInlineQueries. It wassupport_inline_queries, but the API field issupports_inline_queries, so it never decoded. I kept the Go field name so existing code still compiles. Would you like it renamed toSupportsInlineQueriesto match the other fields? That would break code that uses it, so I left it for you to decide.Most of the
models/user.godiff is gofmt realigning the struct. Mini App init data parsing, including the newchat_join_request_query_id, will be a separate PR.Tests cover the request path and fields of both methods, each
resultconstant, and decoding of the new fields and the fixed tag. They pass on Go 1.18.10 and with-raceon Go 1.27.4.Other gaps I found in 10.1–10.3 (none in 10.3), not touched here:
Link,PollMedia.linkandInputMediaLinkare missingInputRichMessageContentdoesn't implementInputMessageContentEditMessageTextParams.Texthas noomitempty, thoughtextis optional whenrich_messageis setInputRichBlockMap.Zoom,WidthandHeightare optional but always sent