Skip to content

fix: correct KeyboardButton.RequestUser type and use pointer for bool…#262

Open
zhenyueyue wants to merge 1 commit intogo-telegram:mainfrom
zhenyueyue:fix/keyboard-button-request-user
Open

fix: correct KeyboardButton.RequestUser type and use pointer for bool…#262
zhenyueyue wants to merge 1 commit intogo-telegram:mainfrom
zhenyueyue:fix/keyboard-button-request-user

Conversation

@zhenyueyue
Copy link

Description

This pull request fixes a bug in the KeyboardButton struct where the RequestUser field was incorrectly typed as *KeyboardButtonRequestUsers instead of *KeyboardButtonRequestUser. Additionally, the optional boolean fields UserIsBot and UserIsPremium in KeyboardButtonRequestUser were defined as non-pointer bool, which prevented the omitempty JSON tag from working correctly (i.e., it was impossible to distinguish between an unset field and an explicit false value).

Changes

  • Changed KeyboardButton.RequestUser type from *KeyboardButtonRequestUsers to *KeyboardButtonRequestUser.
  • Changed KeyboardButtonRequestUser.UserIsBot from bool to *bool.
  • Changed KeyboardButtonRequestUser.UserIsPremium from bool to *bool.

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.

1 participant