diff --git a/bot.go b/bot.go index 7a282fc..01be5f3 100644 --- a/bot.go +++ b/bot.go @@ -620,6 +620,32 @@ func (bot *BotAPI) GetGameHighScores(config GetGameHighScoresConfig) ([]GameHigh return highScores, err } +// AnswerShippingQuery allows you to reply to Update with shipping_query parameter. +func (bot *BotAPI) AnswerShippingQuery(config ShippingConfig) (ShippingQuery, error) { + resp, err := bot.Request(config) + if err != nil { + return ShippingQuery{}, err + } + + var shippingQuery ShippingQuery + err = json.Unmarshal(resp.Result, &shippingQuery) + + return shippingQuery, err +} + +// AnswerPreCheckoutQuery allows you to reply to Update with pre_checkout_query. +func (bot *BotAPI) AnswerPreCheckoutQuery(config PreCheckoutConfig) (PreCheckoutQuery, error) { + resp, err := bot.Request(config) + if err != nil { + return PreCheckoutQuery{}, err + } + + var preCheckoutQuery PreCheckoutQuery + err = json.Unmarshal(resp.Result, &preCheckoutQuery) + + return preCheckoutQuery, err +} + // GetInviteLink get InviteLink for a chat func (bot *BotAPI) GetInviteLink(config ChatInviteLinkConfig) (string, error) { resp, err := bot.Request(config)