fix: correct KeyboardButton.RequestUser type and use pointer for bool…#262
Closed
zhenyueyue wants to merge 1 commit intogo-telegram:mainfrom
Closed
fix: correct KeyboardButton.RequestUser type and use pointer for bool…#262zhenyueyue wants to merge 1 commit intogo-telegram:mainfrom
zhenyueyue wants to merge 1 commit intogo-telegram:mainfrom
Conversation
… fields in KeyboardButtonRequestUser
TGlimmer
added a commit
to TGlimmer/gobot
that referenced
this pull request
Mar 4, 2026
…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
3 tasks
TGlimmer
added a commit
to TGlimmer/gobot
that referenced
this pull request
Mar 4, 2026
…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
ruizlenato
pushed a commit
to ruizlenato/bot
that referenced
this pull request
Mar 5, 2026
negasus
pushed a commit
that referenced
this pull request
Mar 19, 2026
) * fix: resolve issues #242, #245, #261, #262 - #261: fix SetMyProfilePhoto missing `type` field by checking runtime concrete type behind interface fields in buildRequestForm - #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 - #242: handle dual return type (Message or bool) for all Edit*/Stop* methods when editing inline messages - #262: fix KeyboardButton.RequestUser type from *KeyboardButtonRequestUsers to *KeyboardButtonRequestUser, and change UserIsBot/UserIsPremium to *bool * feat: support Telegram Bot API 9.5 - 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 * fix: replace unicode smart quotes with ASCII quotes in ChatMemberMember 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.
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
This pull request fixes a bug in the
KeyboardButtonstruct where theRequestUserfield was incorrectly typed as*KeyboardButtonRequestUsersinstead of*KeyboardButtonRequestUser. Additionally, the optional boolean fieldsUserIsBotandUserIsPremiuminKeyboardButtonRequestUserwere defined as non-pointerbool, which prevented theomitemptyJSON tag from working correctly (i.e., it was impossible to distinguish between an unset field and an explicitfalsevalue).Changes
KeyboardButton.RequestUsertype from*KeyboardButtonRequestUsersto*KeyboardButtonRequestUser.KeyboardButtonRequestUser.UserIsBotfromboolto*bool.KeyboardButtonRequestUser.UserIsPremiumfromboolto*bool.