Skip to content

Commit

Permalink
add callback_game and pay for InlineButton (#680)
Browse files Browse the repository at this point in the history
* add callback_game and pay for InlineButton

* Add new type CallbackGame

---------

Co-authored-by: Sniper_Ji <[email protected]>
  • Loading branch information
SniperUsopp and Sniper_Ji authored Aug 9, 2024
1 parent 226075b commit e90e62d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions game.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ type Game struct {
Animation *Animation `json:"animation"`
}

// CallbackGame is a placeholder, currently holds no information
type CallbackGame struct {
}

// GameHighScore object represents one row
// of the high scores table for a game.
type GameHighScore struct {
Expand All @@ -40,7 +44,6 @@ type GameHighScore struct {
// plus two of their closest neighbors on each side.
// Will also return the top three users
// if the user and his neighbors are not among them.
//
func (b *Bot) GameScores(user Recipient, msg Editable) ([]GameHighScore, error) {
msgID, chatID := msg.MessageSig()

Expand Down Expand Up @@ -73,7 +76,6 @@ func (b *Bot) GameScores(user Recipient, msg Editable) ([]GameHighScore, error)
//
// If the message was sent by the bot, returns the edited Message,
// otherwise returns nil and ErrTrueResult.
//
func (b *Bot) SetGameScore(user Recipient, msg Editable, score GameHighScore) (*Message, error) {
msgID, chatID := msg.MessageSig()

Expand Down
2 changes: 2 additions & 0 deletions markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ type InlineButton struct {
InlineQueryChosenChat *SwitchInlineQuery `json:"switch_inline_query_chosen_chat,omitempty"`
Login *Login `json:"login_url,omitempty"`
WebApp *WebApp `json:"web_app,omitempty"`
CallbackGame *CallbackGame `json:"callback_game,omitempty"`
Pay bool `json:"pay,omitempty"`
}

// MarshalJSON implements json.Marshaler interface.
Expand Down

0 comments on commit e90e62d

Please sign in to comment.