Merge pull request #299 from yi-jiayu/webhook-info-max-connections

Add MaxConnections to WebhookInfo
bot-api-6.1
Syfaro 2020-07-21 03:39:01 -05:00 committed by GitHub
commit 7a018ae873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -523,6 +523,9 @@ func TestSetWebhookWithoutCert(t *testing.T) {
if err != nil {
t.Error(err)
}
if info.MaxConnections == 0 {
t.Errorf("Expected maximum connections to be greater than 0")
}
if info.LastErrorDate != 0 {
t.Errorf("[Telegram callback failed]%s", info.LastErrorMessage)
}

View File

@ -584,6 +584,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"` // optional
}
// IsSet returns true if a webhook is currently set.