diff --git a/telebot/types.py b/telebot/types.py index 7ee76a7..2747851 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -144,14 +144,20 @@ class WebhookInfo(JsonDeserializable): last_error_date = obj['last_error_date'] if 'last_error_message' in obj: last_error_message = obj['last_error_message'] - return cls(url, has_custom_certificate, pending_update_count, last_error_date, last_error_message) + if 'max_connections' in obj: + max_connections = obj['max_connections'] + if 'allowed_updates' in obj: + allowed_updates = obj['allowed_updates'] + return cls(url, has_custom_certificate, pending_update_count, last_error_date, last_error_message, max_connections, allowed_updates) - def __init__(self, url, has_custom_certificate, pending_update_count, last_error_date, last_error_message): + def __init__(self, url, has_custom_certificate, pending_update_count, last_error_date, last_error_message, max_connections, allowed_updates): self.url = url self.has_custom_certificate = has_custom_certificate self.pending_update_count = pending_update_count self.last_error_date = last_error_date self.last_error_message = last_error_message + self.max_connections = max_connections + self.allowed_updates = allowed_updates class User(JsonDeserializable):