From 92739f1414c077da10cc4d90289631bdaa1f4875 Mon Sep 17 00:00:00 2001 From: Demian Date: Tue, 7 Mar 2023 20:25:55 +0200 Subject: [PATCH] api: always specify allowed_updates in getUpdates --- api.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api.go b/api.go index 143c23a..6ed4eb1 100644 --- a/api.go +++ b/api.go @@ -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 {