WebhookInfo¶
- class telegram.WebhookInfo(url, has_custom_certificate, pending_update_count, last_error_date=None, last_error_message=None, max_connections=None, allowed_updates=None, ip_address=None, last_synchronization_error_date=None, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObject
This object represents a Telegram WebhookInfo.
Contains information about the current status of a webhook.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
url
,has_custom_certificate
,pending_update_count
,ip_address
,last_error_date
,last_error_message
,max_connections
,allowed_updates
andlast_synchronization_error_date
are equal.Returned In
Changed in version 20.0:
last_synchronization_error_date
is considered as well when comparing objects of this type in terms of equality.- Parameters:
url (
str
) – Webhook URL, may be empty if webhook is not set up.has_custom_certificate (
bool
) –True
, if a custom certificate was provided for webhook certificate checks.pending_update_count (
int
) – Number of updates awaiting delivery.ip_address (
str
, optional) – Currently used webhook IP address.last_error_date (
datetime.datetime
) –Optional. Datetime for the most recent error that happened when trying to deliver an update via webhook.
Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless
telegram.ext.Defaults.tzinfo
is used.last_error_message (
str
, optional) – Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook.max_connections (
int
, optional) – Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery.allowed_updates (Sequence[
str
], optional) –A list of update types the bot is subscribed to. Defaults to all update types, except
telegram.Update.chat_member
.Changed in version 20.0: Accepts any
collections.abc.Sequence
as input instead of just a list. The input is converted to a tuple.last_synchronization_error_date (
datetime.datetime
, optional) –Datetime of the most recent error that happened when trying to synchronize available updates with Telegram datacenters.
Added in version 20.0.
Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless
telegram.ext.Defaults.tzinfo
is used.
- has_custom_certificate[source]¶
True
, if a custom certificate was provided for webhook certificate checks.- Type:
- last_error_date[source]¶
Optional. Datetime for the most recent error that happened when trying to deliver an update via webhook.
Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless
telegram.ext.Defaults.tzinfo
is used.- Type:
- last_error_message[source]¶
Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook.
- Type:
- max_connections[source]¶
Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery.
- Type:
- allowed_updates[source]¶
Optional. A list of update types the bot is subscribed to. Defaults to all update types, except
telegram.Update.chat_member
.Changed in version 20.0:
This attribute is now an immutable tuple.
This attribute is now always a tuple, that may be empty.
- Type:
Tuple[
str
]
- last_synchronization_error_date[source]¶
Datetime of the most recent error that happened when trying to synchronize available updates with Telegram datacenters.
Added in version 20.0.
Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless
telegram.ext.Defaults.tzinfo
is used.- Type:
datetime.datetime
, optional