Fixes and comments
This commit is contained in:
parent
42d132b90a
commit
41814af2a0
4 changed files with 32 additions and 28 deletions
10
bot.go
10
bot.go
|
@ -705,12 +705,13 @@ 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) (APIResponse, error) {
|
||||
v := url.Values{}
|
||||
|
||||
v.Add("shipping_query_id", config.ShippingQueryID)
|
||||
v.Add("ok", strconv.FormatBool(config.Ok))
|
||||
if config.Ok == true {
|
||||
v.Add("ok", strconv.FormatBool(config.OK))
|
||||
if config.OK == true {
|
||||
data, err := json.Marshal(config.ShippingOptions)
|
||||
if err != nil {
|
||||
return APIResponse{}, err
|
||||
|
@ -725,12 +726,13 @@ func (bot *BotAPI) AnswerShippingQuery(config ShippingConfig) (APIResponse, erro
|
|||
return bot.MakeRequest("answerShippingQuery", v)
|
||||
}
|
||||
|
||||
// AnswerPreCheckoutQuery allows you to reply to Update with pre_checkout_query.
|
||||
func (bot *BotAPI) AnswerPreCheckoutQuery(config PreCheckoutConfig) (APIResponse, error) {
|
||||
v := url.Values{}
|
||||
|
||||
v.Add("pre_checkout_query_id", config.PreCheckoutQueryID)
|
||||
v.Add("ok", strconv.FormatBool(config.Ok))
|
||||
if config.Ok != true {
|
||||
v.Add("ok", strconv.FormatBool(config.OK))
|
||||
if config.OK != true {
|
||||
v.Add("error", config.ErrorMessage)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue