Skip to content

feat: support join request queries from Bot API 10.1 - #323

Merged
negasus merged 2 commits into
go-telegram:mainfrom
INKCR0W:feat-join-request-queries
Nov 23, 2026
Merged

negasus merged 2 commits into
go-telegram:mainfrom
INKCR0W:feat-join-request-queries

Conversation

@INKCR0W

@INKCR0W INKCR0W commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Closes #322

Adds the Join Request Queries part of Bot API 10.1, which #283 didn't cover:

  • ChatJoinRequest.QueryID
  • ChatFullInfo.GuardBot
  • User.SupportsJoinRequestQueries
  • AnswerChatJoinRequestQuery and SendChatJoinRequestWebApp

result gets a models.ChatJoinRequestQueryResult type with approve, decline and queue constants, like ParseMode. It isn't validated, so a value Telegram adds later can still be passed.

Also fixes the tag of User.SupportInlineQueries. It was support_inline_queries, but the API field is supports_inline_queries, so it never decoded. I kept the Go field name so existing code still compiles. Would you like it renamed to SupportsInlineQueries to match the other fields? That would break code that uses it, so I left it for you to decide.

Most of the models/user.go diff is gofmt realigning the struct. Mini App init data parsing, including the new chat_join_request_query_id, will be a separate PR.

Tests cover the request path and fields of both methods, each result constant, and decoding of the new fields and the fixed tag. They pass on Go 1.18.10 and with -race on Go 1.27.4.

Other gaps I found in 10.1–10.3 (none in 10.3), not touched here:

  • 10.1: Link, PollMedia.link and InputMediaLink are missing
  • 10.1: InputRichMessageContent doesn't implement InputMessageContent
  • 10.1: EditMessageTextParams.Text has no omitempty, though text is optional when rich_message is set
  • 10.2: InputRichBlockMap.Zoom, Width and Height are optional but always sent

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.18%. Comparing base (d23f36c) to head (956219d).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@negasus
negasus merged commit c1313b8 into go-telegram:main Nov 23, 2026
3 checks passed
@negasus negasus mentioned this pull request Nov 23, 2026
3 tasks done
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 10.1: Join Request Queries are not supported

3 participants