fix: resolve issues #242, #245, #261, #262 and support Bot API 9.5#263
Open
TGlimmer wants to merge 3 commits intogo-telegram:mainfrom
Open
fix: resolve issues #242, #245, #261, #262 and support Bot API 9.5#263TGlimmer wants to merge 3 commits intogo-telegram:mainfrom
TGlimmer wants to merge 3 commits intogo-telegram:mainfrom
Conversation
…go-telegram#262 - go-telegram#261: fix SetMyProfilePhoto missing `type` field by checking runtime concrete type behind interface fields in buildRequestForm - go-telegram#245: change SwitchInlineQuery and SwitchInlineQueryCurrentChat to *string, and CopyText to *CopyTextButton, to properly handle empty string values and prevent zero-value struct leaking in JSON - go-telegram#242: handle dual return type (Message or bool) for all Edit*/Stop* methods when editing inline messages - go-telegram#262: fix KeyboardButton.RequestUser type from *KeyboardButtonRequestUsers to *KeyboardButtonRequestUser, and change UserIsBot/UserIsPremium to *bool
- Add setChatMemberTag method and SetChatMemberTagParams - Add MessageEntity type "date_time" with unix_time and date_time_format fields - Add tag field to ChatMemberMember and ChatMemberRestricted - Add can_edit_tag to ChatMemberRestricted and ChatPermissions - Add can_manage_tags to ChatMemberAdministrator, ChatAdministratorRights, and PromoteChatMemberParams - Add sender_tag field to Message
f758427 to
9167dc3
Compare
…er struct tags The ChatMemberMember struct contained Unicode right double quotation marks (U+201D) instead of ASCII double quotes (U+0022) in JSON struct tags, causing golangci-lint structtag check to fail. Also fixes smart quotes in comments across ChatMember types for consistency.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #263 +/- ##
==========================================
- Coverage 46.04% 45.79% -0.26%
==========================================
Files 29 29
Lines 2126 2138 +12
==========================================
Hits 979 979
- Misses 1098 1107 +9
- Partials 49 52 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ruizlenato
pushed a commit
to ruizlenato/bot
that referenced
this pull request
Mar 5, 2026
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
SetMyProfilePhotomissingtypefield —buildRequestFormnow checks runtime concrete type behind interface fields viareflect.Value.Elem(), ensuringMarshalInputMedia()is correctly invoked forInputProfilePhotoimplementations.InlineKeyboardButtonempty string handling — ChangedSwitchInlineQueryandSwitchInlineQueryCurrentChatfromstringto*string, andCopyTextfromCopyTextButtonto*CopyTextButton. This preventsomitemptyfrom dropping valid empty strings and stops zero-valueCopyTextButtonfrom leaking into JSON.EditMessageText(and all Edit/Stop methods) returningboolfor inline messages — AddededitMethodRequesthelper that usesjson.RawMessageto handle dual return type (*Messageortrue). Returnsnil, nilfor inline message edits.KeyboardButton.RequestUserincorrect type — Changed from*KeyboardButtonRequestUsersto*KeyboardButtonRequestUser, andUserIsBot/UserIsPremiumfromboolto*bool.setChatMemberTagmethod,date_timeMessageEntity type,tag/can_edit_tag/can_manage_tags/sender_tagfields across ChatMember, Chat, and Message types.Breaking Changes
InlineKeyboardButton.SwitchInlineQuery:string→*stringInlineKeyboardButton.SwitchInlineQueryCurrentChat:string→*stringInlineKeyboardButton.CopyText:CopyTextButton→*CopyTextButtonKeyboardButtonRequestUser.UserIsBot:bool→*boolKeyboardButtonRequestUser.UserIsPremium:bool→*boolKeyboardButton.RequestUser:*KeyboardButtonRequestUsers→*KeyboardButtonRequestUserTest plan
go build ./...passesgo vet ./...passes (only pre-existing warnings in chat_member.go)go test ./...all tests pass