PaidMedia

class telegram.PaidMedia(type, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

Describes the paid media added to a message. Currently, it can be one of:

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their type is equal.

Added in version 21.4.

Parameters:

type (str) – Type of the paid media.

type[source]

Type of the paid media.

Type:

str

PHOTO = 'photo'[source]

telegram.constants.PaidMediaType.PHOTO

PREVIEW = 'preview'[source]

telegram.constants.PaidMediaType.PREVIEW

VIDEO = 'video'[source]

telegram.constants.PaidMediaType.VIDEO

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

Converts JSON data to the appropriate PaidMedia object, i.e. takes care of selecting the correct subclass.

Parameters:
  • data (Dict[str, …]) – The JSON data.

  • bot (telegram.Bot, optional) – The bot associated with this object.

Returns:

The Telegram object.