inline: add game result support (#648)

* feat: add game to the list of inline query results

* fix: documentation and naming
pull/677/head
Reza Alipour 3 months ago committed by GitHub
parent 49db4f5fac
commit 9c4cc7713e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -131,6 +131,8 @@ func inferIQR(result Result) error {
r.Type = "voice"
case *StickerResult:
r.Type = "sticker"
case *GameResult:
r.Type = "game"
default:
return fmt.Errorf("telebot: result %v is not supported", result)
}

@ -60,6 +60,16 @@ func (r *ResultBase) Process(b *Bot) {
}
}
// GameResult represents a game. Game is a content type
// supported by Telegram, which can be sent back to the
// user as a result for an inline query.
type GameResult struct {
ResultBase
// ShortName is a unique identifier of the game.
ShortName string `json:"game_short_name"`
}
// ArticleResult represents a link to an article or web page.
type ArticleResult struct {
ResultBase

Loading…
Cancel
Save