L i>rdZddlZddlmZddlmZmZmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZmZdd lmZmZdd lmZerdd l mZGddeZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#GddeZ$GddeZ%y) zDThis module contains the classes that represent Telegram ChatBoosts.N)Sequence) TYPE_CHECKINGFinalOptional) constants)Chat)TelegramObject)User)enum)de_json_optionalde_list_optionalparse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc@eZdZdZdZdddedeeddffdZxZ S) ChatBoostAddeda This object represents a service message about a user boosting a chat. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`boost_count` are equal. .. versionadded:: 21.0 Args: boost_count (:obj:`int`): Number of boosts added by the user. Attributes: boost_count (:obj:`int`): Number of boosts added by the user. ) boost_countN api_kwargsrrreturncxt||||_|jf|_|j yNr)super__init__r _id_attrs_freeze)selfrr __class__s Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_chatboost.pyrzChatBoostAdded.__init__:s6 J/ +**, ) __name__ __module__ __qualname____doc__ __slots__intrrr __classcell__r s@r!rr&s?"!I *.  X&    r"rc"eZdZUdZdZej jZee e d< ej jZ ee e d< ej jZ ee e d< ddde d e effd Zedd ed e d ddffd ZxZS)ChatBoostSourcea| Base class for Telegram ChatBoostSource objects. It can be one of: * :class:`telegram.ChatBoostSourcePremium` * :class:`telegram.ChatBoostSourceGiftCode` * :class:`telegram.ChatBoostSourceGiveaway` Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`source` is equal. .. versionadded:: 20.8 Args: source (:obj:`str`): The source of the chat boost. Can be one of: :attr:`~telegram.ChatBoostSource.PREMIUM`, :attr:`~telegram.ChatBoostSource.GIFT_CODE`, or :attr:`~telegram.ChatBoostSource.GIVEAWAY`. Attributes: source (:obj:`str`): The source of the chat boost. Can be one of: :attr:`~telegram.ChatBoostSource.PREMIUM`, :attr:`~telegram.ChatBoostSource.GIFT_CODE`, or :attr:`~telegram.ChatBoostSource.GIVEAWAY`. )sourcePREMIUM GIFT_CODEGIVEAWAYNrr-rct||tjtj |||_|j f|_|jyr) rrr get_memberrChatBoostSourcesr-rr)rr-rr s r!rzChatBoostSource.__init__hsE J/ ??9+E+EvvV ++ r"databotrrcz|j|}|jt|jt|j t i}|tur8|jd|vr%||jdj||Sd|vr#t|jdt||d<t|)||S),See :meth:`telegram.TelegramObject.de_json`.r-r4r5user) _parse_datar.ChatBoostSourcePremiumr/ChatBoostSourceGiftCoder0ChatBoostSourceGiveawayr,getpopde_jsonr r r)clsr4r5_class_mappingr s r!r@zChatBoostSource.de_jsonqst$ KK/ MM2 LL1<  / !dhhx&8N&J!$((8"45==4S=Q Q T>+DHHV,%66@@IuSz@@$55>>HeCj>?HLs8H3E383(5/3EV33r"r,c<eZdZdZdZdddedeeffdZxZ S)r;a The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. .. versionadded:: 20.8 Args: user (:class:`telegram.User`): User that boosted the chat. Attributes: source (:obj:`str`): The source of the chat boost. Always :attr:`~telegram.ChatBoostSource.PREMIUM`. user (:class:`telegram.User`): User that boosted the chat. r9Nrr9rct||j||j5||_dddy#1swYyxYwN)r-r)rrr. _unfrozenr9rr9rr s r!rzChatBoostSourcePremium.__init__s?  D ^^  #"DI # # # >A r#r$r%r&r'r rrrr)r*s@r!r;r;s/ IGK#T#(82D##r"r;c<eZdZdZdZdddedeeffdZxZ S)r<a) The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. .. versionadded:: 20.8 Args: user (:class:`telegram.User`): User for which the gift code was created. Attributes: source (:obj:`str`): The source of the chat boost. Always :attr:`~telegram.ChatBoostSource.GIFT_CODE`. user (:class:`telegram.User`): User for which the gift code was created. rHNrr9rct||j||j5||_dddy#1swYyxYwrJ)rrr/rKr9rLs r!rz ChatBoostSourceGiftCode.__init__s? :F ^^  #"DI # # #rMrNr*s@r!r<r<s/ IGK#T#(82D##r"r<c beZdZdZdZ d dddedeedeedeed ee f fd Z xZ S) r=a  The boost was obtained by the creation of a Telegram Premium giveaway or a Telegram Star. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and :attr:`prize_star_count` / 500 times for one year for Telegram Star giveaways. .. versionadded:: 20.8 Args: giveaway_message_id (:obj:`int`): Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. user (:class:`telegram.User`, optional): User that won the prize in the giveaway if any; for Telegram Premium giveaways only. prize_star_count (:obj:`int`, optional): The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only. .. versionadded:: 21.6 is_unclaimed (:obj:`bool`, optional): :obj:`True`, if the giveaway was completed, but there was no user to win the prize. Attributes: source (:obj:`str`): Source of the boost. Always :attr:`~telegram.ChatBoostSource.GIVEAWAY`. giveaway_message_id (:obj:`int`): Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. user (:class:`telegram.User`): Optional. User that won the prize in the giveaway if any. prize_star_count (:obj:`int`): Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only. .. versionadded:: 21.6 is_unclaimed (:obj:`bool`): Optional. :obj:`True`, if the giveaway was completed, but there was no user to win the prize. )giveaway_message_id is_unclaimedprize_star_countr9NrrRr9rSrTrct||j||j5||_||_||_||_dddy#1swYyxYwrJ)rrr0rKrRr9rTrS)rrRr9rSrTrr s r!rz ChatBoostSourceGiveaway.__init__sY  *E ^^  =,?D $(,DI3CD !0r,rrrr@rAr4r5 loc_tzinfor s r!r@zChatBoost.de_json st$)$((8*zRZ"0:K1LU_"` wDc22r"rC)r#r$r%r&r'rDdtmdatetimer,rrrrFr@r)r*s@r!rXrXs6FI*.,,   X&& 38 3(5/ 3[ 3 3r"rXcjeZdZdZdZdddededeeffdZ e dd ed ed d dffd Z xZ S)ChatBoostUpdateda;This object represents a boost added to a chat or changed. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`chat`, and :attr:`boost` are equal. .. versionadded:: 20.8 Args: chat (:class:`telegram.Chat`): Chat which was boosted. boost (:class:`telegram.ChatBoost`): Information about the chat boost. Attributes: chat (:class:`telegram.Chat`): Chat which was boosted. boost (:class:`telegram.ChatBoost`): Information about the chat boost. )boostchatNrrgrfrct||||_||_|jj|jf|_|j yr)rrrgrfidrr)rrgrfrr s r!rzChatBoostUpdated.__init__@sD J/ % )),, 3 r"r4r5rrc|j|}t|jdt||d<t|jdt||d<t |||S)r7rgrfr8)r:r r>rrXrr@rAr4r5r s r!r@zChatBoostUpdated.de_jsonOs\t$'(8$DV ('):IsKW wDc22r"rC) r#r$r%r&r'rrXrrrrFr@r)r*s@r!rere-sh "I*.    X& 383(5/3EW33r"rec eZdZdZdZdddededejde d e e f fd Z e dd e d e d ddffd ZxZS)ChatBoostRemoveda 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:`telegram.Chat`): Chat which was boosted. boost_id (:obj:`str`): Unique identifier of the boost. remove_date (:obj:`datetime.datetime`): Point in time when the boost was removed. source (:class:`telegram.ChatBoostSource`): Source of the removed boost. Attributes: chat (:class:`telegram.Chat`): Chat which was boosted. boost_id (:obj:`str`): Unique identifier of the boost. remove_date (:obj:`datetime.datetime`): Point in time when the boost was removed. |datetime_localization| source (:class:`telegram.ChatBoostSource`): Source of the removed boost. )rZrg remove_dater-NrrgrZrnr-rct||||_||_||_||_|j|j|j|j f|_|jyr)rrrgrZrnr-rr)rrgrZrnr-rr s r!rzChatBoostRemoved.__init__rs] J/ % )4'- ))T]]D4D4DdkkR r"r4r5rrc(|j|}t|jdt||d<t|jdt||d<t |}t |jd||d<t|!||S)r7rgr-rnr^r8) r:r r>rr,rrrr@r`s r!r@zChatBoostRemoved.de_jsonst$'(8$DV )$((8*I*.\\   X&& 38 3(5/ 3EW 3 3r"rmcleZdZdZdZdddeedeeffdZ e d ded ed d dffd Z xZ S)UserChatBoostsaThis object represents a list of boosts added to a chat by a user. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`boosts` are equal. .. versionadded:: 20.8 Args: boosts (Sequence[:class:`telegram.ChatBoost`]): List of boosts added to the chat by the user. Attributes: boosts (tuple[:class:`telegram.ChatBoost`]): List of boosts added to the chat by the user. )boostsNrrsrct||t||_|jf|_|j yr)rrrrsrr)rrsrr s r!rzUserChatBoosts.__init__s7 J/-?-G ++ r"r4r5rrc|j|}t|jdt||d<t|||S)r7rsr8)r:r r>rXrr@rks r!r@zUserChatBoosts.de_jsonsAt$)$((8*rs&K$113 bbQ*^B;3n;3|#_#2#o#44=o4=n;3;3|*3~*3Z53~53p&3^&3r"