This object represents a boost removed from a chat. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`chat`, :attr:`boost_id`, :attr:`remove_date`, and :attr:`source` are equal. Args: chat (:class
| 344 | |
| 345 | |
| 346 | class ChatBoostRemoved(TelegramObject): |
| 347 | """ |
| 348 | This object represents a boost removed from a chat. |
| 349 | |
| 350 | Objects of this class are comparable in terms of equality. Two objects of this class are |
| 351 | considered equal, if their :attr:`chat`, :attr:`boost_id`, :attr:`remove_date`, and |
| 352 | :attr:`source` are equal. |
| 353 | |
| 354 | Args: |
| 355 | chat (:class:`telegram.Chat`): Chat which was boosted. |
| 356 | boost_id (:obj:`str`): Unique identifier of the boost. |
| 357 | remove_date (:obj:`datetime.datetime`): Point in time when the boost was removed. |
| 358 | source (:class:`telegram.ChatBoostSource`): Source of the removed boost. |
| 359 | |
| 360 | Attributes: |
| 361 | chat (:class:`telegram.Chat`): Chat which was boosted. |
| 362 | boost_id (:obj:`str`): Unique identifier of the boost. |
| 363 | remove_date (:obj:`datetime.datetime`): Point in time when the boost was removed. |
| 364 | |datetime_localization| |
| 365 | source (:class:`telegram.ChatBoostSource`): Source of the removed boost. |
| 366 | """ |
| 367 | |
| 368 | __slots__ = ("boost_id", "chat", "remove_date", "source") |
| 369 | |
| 370 | def __init__( |
| 371 | self, |
| 372 | chat: Chat, |
| 373 | boost_id: str, |
| 374 | remove_date: dtm.datetime, |
| 375 | source: ChatBoostSource, |
| 376 | *, |
| 377 | api_kwargs: JSONDict | None = None, |
| 378 | ): |
| 379 | super().__init__(api_kwargs=api_kwargs) |
| 380 | |
| 381 | self.chat: Chat = chat |
| 382 | self.boost_id: str = boost_id |
| 383 | self.remove_date: dtm.datetime = remove_date |
| 384 | self.source: ChatBoostSource = source |
| 385 | |
| 386 | self._id_attrs = (self.chat, self.boost_id, self.remove_date, self.source) |
| 387 | self._freeze() |
| 388 | |
| 389 | @classmethod |
| 390 | def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "ChatBoostRemoved": |
| 391 | """See :meth:`telegram.TelegramObject.de_json`.""" |
| 392 | data = cls._parse_data(data) |
| 393 | |
| 394 | data["chat"] = de_json_optional(data.get("chat"), Chat, bot) |
| 395 | data["source"] = de_json_optional(data.get("source"), ChatBoostSource, bot) |
| 396 | loc_tzinfo = extract_tzinfo_from_defaults(bot) |
| 397 | data["remove_date"] = from_timestamp(data.get("remove_date"), tzinfo=loc_tzinfo) |
| 398 | |
| 399 | return super().de_json(data=data, bot=bot) |
| 400 | |
| 401 | |
| 402 | class UserChatBoosts(TelegramObject): |
no outgoing calls
searching dependent graphs…