MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / PaidMediaVideo

Class PaidMediaVideo

src/telegram/_paidmedia.py:217–255  ·  view source on GitHub ↗

The paid media is a video. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`video` are equal. .. versionadded:: 21.4 Args: type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.P

Source from the content-addressed store, hash-verified

215
216
217class PaidMediaVideo(PaidMedia):
218 """
219 The paid media is a video.
220
221 Objects of this class are comparable in terms of equality. Two objects of this class are
222 considered equal, if their :attr:`video` are equal.
223
224 .. versionadded:: 21.4
225
226 Args:
227 type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
228 video (:class:`telegram.Video`): The video.
229
230 Attributes:
231 type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
232 video (:class:`telegram.Video`): The video.
233 """
234
235 __slots__ = ("video",)
236
237 def __init__(
238 self,
239 video: Video,
240 *,
241 api_kwargs: JSONDict | None = None,
242 ) -> None:
243 super().__init__(type=PaidMedia.VIDEO, api_kwargs=api_kwargs)
244
245 with self._unfrozen():
246 self.video: Video = video
247
248 self._id_attrs = (self.type, self.video)
249
250 @classmethod
251 def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "PaidMediaVideo":
252 data = cls._parse_data(data)
253
254 data["video"] = de_json_optional(data.get("video"), Video, bot)
255 return super().de_json(data=data, bot=bot) # type: ignore[return-value]
256
257
258class PaidMediaLivePhoto(PaidMedia):

Callers 4

paid_media_videoFunction · 0.90
test_equalityMethod · 0.90

Calls

no outgoing calls

Tested by 2

paid_media_videoFunction · 0.72
test_equalityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…