pull/131/merge
Narrator69 7 years ago committed by GitHub
commit 3105cdb176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      bot.go
  2. 1
      types.go

@ -423,6 +423,14 @@ func (bot *BotAPI) GetUpdates(config UpdateConfig) ([]Update, error) {
var updates []Update
json.Unmarshal(resp.Result, &updates)
// Every update contains raw JSON which
// can include information about other
// updates. This is because response is
// single for all. Be aware.
for _, v := range updates {
v.RawUpdateJSON = string(resp.Result)
}
bot.debugLog("getUpdates", v, updates)
return updates, nil
@ -529,6 +537,7 @@ func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel {
var update Update
json.Unmarshal(bytes, &update)
update.RawUpdateJSON = string(bytes)
ch <- update
})

@ -37,6 +37,7 @@ type Update struct {
CallbackQuery *CallbackQuery `json:"callback_query"`
ShippingQuery *ShippingQuery `json:"shipping_query"`
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query"`
RawUpdateJSON string
}
// UpdatesChannel is the channel for getting updates.