L iAdZddlZddlmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZdd lmZerdd lmZGd deZGddeZGddeZGddeZGddeZGddeZy)z4This module contains classes related to unique gifs.N) TYPE_CHECKINGFinalOptional) constants)Chat)Sticker)TelegramObject)enum)de_json_optional)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc neZdZdZdZdddedededee ffd Z e dd e d ed d dffd Z xZ S)UniqueGiftModelaSThis object describes the model of a unique gift. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`name`, :attr:`sticker` and :attr:`rarity_per_mille` are equal. .. versionadded:: 22.1 Args: name (:obj:`str`): Name of the model. sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift. rarity_per_mille (:obj:`int`): The number of unique gifts that receive this model for every ``1000`` gifts upgraded. Attributes: name (:obj:`str`): Name of the model. sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift. rarity_per_mille (:obj:`int`): The number of unique gifts that receive this model for every ``1000`` gifts upgraded. namerarity_per_millestickerN api_kwargsrrrrct||||_||_||_|j|j|jf|_|j yNrsuper__init__rrr _id_attrs_freezeselfrrrr __class__s Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_uniquegift.pyrzUniqueGiftModel.__init__BP J/ ' %5))T\\43H3HI databotrreturnc|j|}t|jdt||d<t|||S,See :meth:`telegram.TelegramObject.de_json`.rr%r& _parse_datar getrrde_jsonclsr%r&r!s r"r/zUniqueGiftModel.de_jsonSAt$*488I+>MYwDc22r$N__name__ __module__ __qualname____doc__ __slots__strrintrrr classmethodr/ __classcell__r!s@r"rr&sr*I*.   X& "383(5/3EV33r$rc neZdZdZdZdddedededee ffd Z e dd e d ed d dffd Z xZ S)UniqueGiftSymbolakThis object describes the symbol shown on the pattern of a unique gift. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`name`, :attr:`sticker` and :attr:`rarity_per_mille` are equal. .. versionadded:: 22.1 Args: name (:obj:`str`): Name of the symbol. sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift. rarity_per_mille (:obj:`int`): The number of unique gifts that receive this model for every ``1000`` gifts upgraded. Attributes: name (:obj:`str`): Name of the symbol. sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift. rarity_per_mille (:obj:`int`): The number of unique gifts that receive this model for every ``1000`` gifts upgraded. rNrrrrrct||||_||_||_|j|j|jf|_|j yrrrs r"rzUniqueGiftSymbol.__init__yr#r$r%r&rr'c|j|}t|jdt||d<t|||Sr)r,r0s r"r/zUniqueGiftSymbol.de_jsonr2r$r3r4r>s@r"r@r@]sr*I*.   X& "383(5/3EW33r$r@c HeZdZdZdZdddedededed eef fd ZxZ S) UniqueGiftBackdropColorsa"This object describes the colors of the backdrop of a unique gift. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`center_color`, :attr:`edge_color`, :attr:`symbol_color`, and :attr:`text_color` are equal. .. versionadded:: 22.1 Args: center_color (:obj:`int`): The color in the center of the backdrop in RGB format. edge_color (:obj:`int`): The color on the edges of the backdrop in RGB format. symbol_color (:obj:`int`): The color to be applied to the symbol in RGB format. text_color (:obj:`int`): The color for the text on the backdrop in RGB format. Attributes: center_color (:obj:`int`): The color in the center of the backdrop in RGB format. edge_color (:obj:`int`): The color on the edges of the backdrop in RGB format. symbol_color (:obj:`int`): The color to be applied to the symbol in RGB format. text_color (:obj:`int`): The color for the text on the backdrop in RGB format. ) center_color edge_color symbol_color text_colorNrrErFrGrHrct||||_||_||_||_|j|j|j|j f|_|jyr)rrrErFrGrHrr)r rErFrGrHrr!s r"rz!UniqueGiftBackdropColors.__init__sc J/!-)!-)++T__d>O>OQUQ`Q`a r$) r5r6r7r8r9r;rrrr=r>s@r"rDrDsS,I*.   X&r$rDc neZdZdZdZdddedededee ffd Z e dd e d ed d dffd Z xZ S)UniqueGiftBackdropaXThis object describes the backdrop of a unique gift. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`name`, :attr:`colors`, and :attr:`rarity_per_mille` are equal. .. versionadded:: 22.1 Args: name (:obj:`str`): Name of the backdrop. colors (:class:`telegram.UniqueGiftBackdropColors`): Colors of the backdrop. rarity_per_mille (:obj:`int`): The number of unique gifts that receive this backdrop for every ``1000`` gifts upgraded. Attributes: name (:obj:`str`): Name of the backdrop. colors (:class:`telegram.UniqueGiftBackdropColors`): Colors of the backdrop. rarity_per_mille (:obj:`int`): The number of unique gifts that receive this backdrop for every ``1000`` gifts upgraded. )colorsrrNrrrLrrct||||_||_||_|j|j|jf|_|j yr)rrrrLrrr)r rrLrrr!s r"rzUniqueGiftBackdrop.__init__sP J/ 06 %5))T[[$2G2GH r$r%r&rr'c|j|}t|jdt||d<t|||S)r*rLr+)r-r r.rDrr/r0s r"r/zUniqueGiftBackdrop.de_jsonsCt$)$((8*<>VX[\XwDc22r$r3)r5r6r7r8r9r:rDr;rrrr<r/r=r>s@r"rKrKsr*I*. )  X& "383(5/3EY33r$rKceZdZdZdZ ddddedededed ed e d e e d e e ffd Z edde de dddffd ZxZS) UniqueGifta`This object describes a unique gift that was upgraded from a regular gift. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`base_name`, :attr:`name`, :attr:`number`, :class:`model`, :attr:`symbol`, and :attr:`backdrop` are equal. .. versionadded:: 22.1 Args: base_name (:obj:`str`): Human-readable name of the regular gift from which this unique gift was upgraded. name (:obj:`str`): Unique name of the gift. This name can be used in ``https://t.me/nft/...`` links and story areas. number (:obj:`int`): Unique number of the upgraded gift among gifts upgraded from the same regular gift. model (:class:`UniqueGiftModel`): Model of the gift. symbol (:class:`UniqueGiftSymbol`): Symbol of the gift. backdrop (:class:`UniqueGiftBackdrop`): Backdrop of the gift. publisher_chat (:class:`telegram.Chat`, optional): Information about the chat that published the gift. .. versionadded:: 22.4 Attributes: base_name (:obj:`str`): Human-readable name of the regular gift from which this unique gift was upgraded. name (:obj:`str`): Unique name of the gift. This name can be used in ``https://t.me/nft/...`` links and story areas. number (:obj:`int`): Unique number of the upgraded gift among gifts upgraded from the same regular gift. model (:class:`telegram.UniqueGiftModel`): Model of the gift. symbol (:class:`telegram.UniqueGiftSymbol`): Symbol of the gift. backdrop (:class:`telegram.UniqueGiftBackdrop`): Backdrop of the gift. publisher_chat (:class:`telegram.Chat`): Optional. Information about the chat that published the gift. .. versionadded:: 22.4 )backdrop base_namemodelrnumberpublisher_chatsymbolNrrRrrTrSrVrQrUrc:t ||||_||_||_||_||_||_||_|j|j|j|j |j |jf|_ |jyr) rrrRrrTrSrVrQrUrr) r rRrrTrSrVrQrUrr!s r"rzUniqueGift.__init__0s J/' ! &+ (. ,4 .< NN II KK JJ KK MM   r$r%r&rr'c`|j|}t|jdt||d<t|jdt||d<t|jdt ||d<t|jdt ||d<t|!||S)r*rSrVrQrUr+) r-r r.rr@rKrrr/r0s r"r/zUniqueGift.de_jsonPst$('):OSQW )$((8*<>NPSTX+DHHZ,@BTVYZZ!1$((;K2LdTW!X wDc22r$r3)r5r6r7r8r9r:r;rr@rKrrrrr<r/r=r>s@r"rPrPs&PI$*.*.    ! %!X&@ 38 3(5/ 3\ 3 3r$rPcleZdZUdZej j Zeee d< ej jZ eee d< ej jZ eee d< dZ dddde d ed eed eed eed eej"deeffdZeddededddffd ZxZS)UniqueGiftInfoao Describes a service message about a unique gift that was sent or received. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`gift`, and :attr:`origin` are equal. .. versionadded:: 22.1 Args: gift (:class:`UniqueGift`): Information about the gift. origin (:obj:`str`): Origin of the gift. Currently, either :attr:`UPGRADE` for gifts upgraded from regular gifts, :attr:`TRANSFER` for gifts transferred from other users or channels, or :attr:`RESALE` for gifts bought from other users. .. versionchanged:: 22.3 The :attr:`RESALE` origin was added. owned_gift_id (:obj:`str`, optional) Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts. transfer_star_count (:obj:`int`, optional): Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift. last_resale_star_count (:obj:`int`, optional): For gifts bought from other users, the price paid for the gift. .. versionadded:: 22.3 next_transfer_date (:obj:`datetime.datetime`, optional): Date when the gift can be transferred. If it's in the past, then the gift can be transferred now. |datetime_localization| .. versionadded:: 22.3 Attributes: gift (:class:`UniqueGift`): Information about the gift. origin (:obj:`str`): Origin of the gift. Currently, either :attr:`UPGRADE` for gifts upgraded from regular gifts, :attr:`TRANSFER` for gifts transferred from other users or channels, or :attr:`RESALE` for gifts bought from other users. .. versionchanged:: 22.3 The :attr:`RESALE` origin was added. owned_gift_id (:obj:`str`) Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts. transfer_star_count (:obj:`int`): Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift. last_resale_star_count (:obj:`int`): Optional. For gifts bought from other users, the price paid for the gift. .. versionadded:: 22.3 next_transfer_date (:obj:`datetime.datetime`): Optional. Date when the gift can be transferred. If it's in the past, then the gift can be transferred now. |datetime_localization| .. versionadded:: 22.3 UPGRADETRANSFERRESALE)giftlast_resale_star_countnext_transfer_dateorigin owned_gift_idtransfer_star_countNrr^rarbrcr_r`rct||||_tjt j |||_||_||_ ||_ ||_ |j|jf|_ |jyr)rrr^r get_memberrUniqueGiftInfoOriginrarbrcr_r`rr) r r^rarbrcr_r`rr!s r"rzUniqueGiftInfo.__init__st J/ $ ??9+I+I6SYZ ,92E 5K#:L))T[[1 r$r%r&rr'c|j|}t|}t|jdt||d<t |jd||d<t |||S)r*r^r`)tzinfor+)r-r r r.rPr rr/)r1r%r& loc_tzinfor!s r"r/zUniqueGiftInfo.de_jsonslt$1#6 '(8*cJV %3 HH) *:&  !"wDc22r$)NNNNr3)r5r6r7r8rrfr[rr:__annotations__r\r]r9rPrr;dtmdatetimerrr<r/r=r>s@r"rZrZ]s2h$88@@GU3Z@B$99BBHeCjBC"77>>FE#J> I(,-10459*. }  &c]  !) %S\\2X&2 38 3(5/ 3EU 3 3r$rZ)r8rlrktypingrrrtelegramrtelegram._chatrtelegram._files.stickerrtelegram._telegramobjectr telegram._utilsr telegram._utils.argumentparsingr telegram._utils.datetimer r telegram._utils.typesrrrr@rDrKrPrZr$r"rws(;11+3 <Q*43n43n43~43n/~/d4343n]3]3@l3^l3r$