Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# PaidMediaPreview

class telegram.PaidMediaPreview(width=None, height=None, duration=None, *, api_kwargs=None)

  Bases: `telegram.PaidMedia`

  The paid media isn’t available before the payment.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `width`, `height`, and `duration` are equal.

  Available In

  - `telegram.ExternalReplyInfo.paid_media`

  - `telegram.PaidMediaInfo.paid_media`

  - `telegram.TransactionPartnerUser.paid_media`

  Added in version 21.4.

  Parameters:

    - type (`str`) – Type of the paid media, always `'preview'`.

    - width (`int`, optional) – Media width as defined by the sender.

    - height (`int`, optional) – Media height as defined by the sender.

    - duration (`int`, optional) – Duration of the media in seconds as defined by the sender.

  type

    Type of the paid media, always `'preview'`.

    Type:

      `str`

  width

    Optional. Media width as defined by the sender.

    Type:

      `int`

  height

    Optional. Media height as defined by the sender.

    Type:

      `int`

  duration

    Optional. Duration of the media in seconds as defined by the sender.

    Type:

      `int`