Skip to content

Commit

Permalink
api: always specify allowed_updates in getUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Mar 7, 2023
1 parent 8a14d8a commit 92739f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,12 @@ func (b *Bot) getUpdates(offset, limit int, timeout time.Duration, allowed []str
"timeout": strconv.Itoa(int(timeout / time.Second)),
}

data, _ := json.Marshal(allowed)
params["allowed_updates"] = string(data)

if limit != 0 {
params["limit"] = strconv.Itoa(limit)
}
if len(allowed) > 0 {
data, _ := json.Marshal(allowed)
params["allowed_updates"] = string(data)
}

data, err := b.Raw("getUpdates", params)
if err != nil {
Expand Down

0 comments on commit 92739f1

Please sign in to comment.