PaidMediaPreview¶
- class telegram.PaidMediaPreview(width=None, height=None, duration=None, *, api_kwargs=None)[source]¶
Bases:
telegram.PaidMediaThe 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, anddurationare equal.Added in version 21.4.
Changed in version v22.2: As part of the migration to representing time periods using
datetime.timedelta, equality comparison now considers integer durations and equivalent timedeltas as equal.- Parameters:
width (
int, optional) – Media width as defined by the sender.height (
int, optional) – Media height as defined by the sender.duration (
int|datetime.timedelta, optional) –Duration of the media in seconds as defined by the sender.
Changed in version v22.2:
datetime.timedeltaobjects are accepted in addition to plainintvalues.
- duration[source]¶
Optional. Duration of the media in seconds as defined by the sender.
Deprecated since version v22.2: In a future major version this attribute will be of type
datetime.timedelta. You can opt-in early by setting PTB_TIMEDELTA=true orPTB_TIMEDELTA=1as an environment variable.- Type:
int|datetime.timedelta