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 and last_synchronization_error_date are equal.

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[source]

Webhook URL, may be empty if webhook is not set up.

Type:

str

has_custom_certificate[source]

True, if a custom certificate was provided for webhook certificate checks.

Type:

bool

pending_update_count[source]

Number of updates awaiting delivery.

Type:

int

ip_address[source]

Optional. Currently used webhook IP address.

Type:

str

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:

datetime.datetime

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:

str

max_connections[source]

Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery.

Type:

int

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

classmethod de_json(data, bot=None)[source]

See telegram.TelegramObject.de_json().