From 69bab9a28f2047c696d5c4d1c088fca6a2768bb8 Mon Sep 17 00:00:00 2001 From: Jiayu Yi Date: Mon, 13 Jan 2020 15:42:35 +0800 Subject: [PATCH] Add MaxConnections to WebhookInfo --- bot_test.go | 3 +++ types.go | 1 + 2 files changed, 4 insertions(+) diff --git a/bot_test.go b/bot_test.go index 60f3e65..b00ea41 100644 --- a/bot_test.go +++ b/bot_test.go @@ -497,6 +497,9 @@ func TestSetWebhookWithoutCert(t *testing.T) { if err != nil { t.Error(err) } + if info.MaxConnections == 0 { + t.Errorf("wanted max connections to be greater than 0") + } if info.LastErrorDate != 0 { t.Errorf("[Telegram callback failed]%s", info.LastErrorMessage) } diff --git a/types.go b/types.go index 70d66fa..b673dc6 100644 --- a/types.go +++ b/types.go @@ -571,6 +571,7 @@ type WebhookInfo struct { PendingUpdateCount int `json:"pending_update_count"` LastErrorDate int `json:"last_error_date"` // optional LastErrorMessage string `json:"last_error_message"` // optional + MaxConnections int `json:"max_connections"` } // IsSet returns true if a webhook is currently set.