Add AnswerShippingQuery and AnswerPreCheckoutQuery functions
parent
3cb910b3f0
commit
b3ff45389c
26
bot.go
26
bot.go
|
@ -620,6 +620,32 @@ func (bot *BotAPI) GetGameHighScores(config GetGameHighScoresConfig) ([]GameHigh
|
||||||
return highScores, err
|
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
|
// GetInviteLink get InviteLink for a chat
|
||||||
func (bot *BotAPI) GetInviteLink(config ChatInviteLinkConfig) (string, error) {
|
func (bot *BotAPI) GetInviteLink(config ChatInviteLinkConfig) (string, error) {
|
||||||
resp, err := bot.Request(config)
|
resp, err := bot.Request(config)
|
||||||
|
|
Loading…
Reference in New Issue