api: always specify allowed_updates in getUpdates

v3.1.3
Demian 2 years ago
parent ad84cbde5a
commit e3c38d400f

@ -217,12 +217,11 @@ func (b *Bot) getUpdates(offset, limit int, timeout time.Duration, allowed []str
"timeout": strconv.Itoa(int(timeout / time.Second)), "timeout": strconv.Itoa(int(timeout / time.Second)),
} }
if limit != 0 {
params["limit"] = strconv.Itoa(limit)
}
if len(allowed) > 0 {
data, _ := json.Marshal(allowed) data, _ := json.Marshal(allowed)
params["allowed_updates"] = string(data) params["allowed_updates"] = string(data)
if limit != 0 {
params["limit"] = strconv.Itoa(limit)
} }
data, err := b.Raw("getUpdates", params) data, err := b.Raw("getUpdates", params)

Loading…
Cancel
Save