Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback: add missing struct fields #647

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

rapour
Copy link
Contributor

@rapour rapour commented Feb 3, 2024

The telegram Bot API includes chat_instance and game_short_name in its CallbackQuery object. Particularly, the game_short_name is currently missing in the Callback object of the update when a user requests a game's url from the bot and it's also not deserialized in the Game object of the callback's message.

I think it might be nice to have the Callback struct conforming with Telegram's CallbackQuery object and also a lot easier to implement than somehow populating the Game struct in the message.

callback.go Outdated
@@ -26,6 +26,15 @@ type Callback struct {
// a bad client can send arbitrary data in this field.
Data string `json:"data"`

// Global identifier, uniquely corresponding to the chat to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the documentation:

Suggested change
// Global identifier, uniquely corresponding to the chat to
// ChatInstance is a global identifier, uniquely corresponding to the chat to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

callback.go Outdated
// which the message with the callback button was sent.
ChatInstance string `json:"chat_instance"`

// Unique identifier of the game for which a URL is requested
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@demget demget added this to the v3.3 milestone Feb 20, 2024
@demget demget changed the title CallBack struct missing some fields callback: add missing struct fields Feb 20, 2024
@rapour rapour requested a review from demget February 21, 2024 21:57
@demget
Copy link
Collaborator

demget commented Feb 25, 2024

Good catch, thank you for filling the hole in our API.

@demget demget merged commit 49db4f5 into tucnak:v3 Feb 25, 2024
1 check passed
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.

2 participants