Describes the paid media added to a message. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`star_count` and :attr:`paid_media` are equal. .. versionadded:: 21.4 Args: star_count (:obj:`int`):
| 297 | |
| 298 | |
| 299 | class PaidMediaInfo(TelegramObject): |
| 300 | """ |
| 301 | Describes the paid media added to a message. |
| 302 | |
| 303 | Objects of this class are comparable in terms of equality. Two objects of this class are |
| 304 | considered equal, if their :attr:`star_count` and :attr:`paid_media` are equal. |
| 305 | |
| 306 | .. versionadded:: 21.4 |
| 307 | |
| 308 | Args: |
| 309 | star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to |
| 310 | the media. |
| 311 | paid_media (Sequence[:class:`telegram.PaidMedia`]): Information about the paid media. |
| 312 | |
| 313 | Attributes: |
| 314 | star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to |
| 315 | the media. |
| 316 | paid_media (tuple[:class:`telegram.PaidMedia`]): Information about the paid media. |
| 317 | """ |
| 318 | |
| 319 | __slots__ = ("paid_media", "star_count") |
| 320 | |
| 321 | def __init__( |
| 322 | self, |
| 323 | star_count: int, |
| 324 | paid_media: Sequence[PaidMedia], |
| 325 | *, |
| 326 | api_kwargs: JSONDict | None = None, |
| 327 | ) -> None: |
| 328 | super().__init__(api_kwargs=api_kwargs) |
| 329 | self.star_count: int = star_count |
| 330 | self.paid_media: tuple[PaidMedia, ...] = parse_sequence_arg(paid_media) |
| 331 | |
| 332 | self._id_attrs = (self.star_count, self.paid_media) |
| 333 | self._freeze() |
| 334 | |
| 335 | @classmethod |
| 336 | def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "PaidMediaInfo": |
| 337 | data = cls._parse_data(data) |
| 338 | |
| 339 | data["paid_media"] = de_list_optional(data.get("paid_media"), PaidMedia, bot) |
| 340 | return super().de_json(data=data, bot=bot) |
| 341 | |
| 342 | |
| 343 | class PaidMediaPurchased(TelegramObject): |
no outgoing calls
searching dependent graphs…