
    YPiA                        d Z ddlZddlmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ erddlmZ  G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)z4This module contains classes related to unique gifs.    N)TYPE_CHECKINGFinalOptional)	constants)Chat)Sticker)TelegramObject)enum)de_json_optional)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc            
       n     e Zd ZdZdZdddedededee	   f fd	Z
edd
e	ded   dd f fd       Z xZS )UniqueGiftModelaS  This 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.

    namerarity_per_millestickerN
api_kwargsr   r   r   r   c                    t         |   |       || _        || _        || _        | j                  | j                  | j                  f| _        | j                          y Nr   super__init__r   r   r   	_id_attrs_freezeselfr   r   r   r   	__class__s        J/root/twitch_bot/venv/lib/python3.12/site-packages/telegram/_uniquegift.pyr   zUniqueGiftModel.__init__B   P     	J/	 '%5))T\\43H3HI    databotr   returnc                     | j                  |      }t        |j                  d      t        |      |d<   t        |   ||      S ,See :meth:`telegram.TelegramObject.de_json`.r   r%   r&   _parse_datar   getr   r   de_jsonclsr%   r&   r!   s      r"   r/   zUniqueGiftModel.de_jsonS   A     t$*488I+>MYwDc22r$   N__name__
__module____qualname____doc__	__slots__strr   intr   r   r   classmethodr/   __classcell__r!   s   @r"   r   r   &   sr    *I *.  	 X&" 38 3(5/ 3EV 3 3r$   r   c            
       n     e Zd ZdZdZdddedededee	   f fd	Z
edd
e	ded   dd f fd       Z xZS )UniqueGiftSymbolak  This 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.

    r   Nr   r   r   r   r   c                    t         |   |       || _        || _        || _        | j                  | j                  | j                  f| _        | j                          y r   r   r   s        r"   r   zUniqueGiftSymbol.__init__y   r#   r$   r%   r&   r   r'   c                     | j                  |      }t        |j                  d      t        |      |d<   t        |   ||      S r)   r,   r0   s      r"   r/   zUniqueGiftSymbol.de_json   r2   r$   r3   r4   r>   s   @r"   r@   r@   ]   sr    *I *.  	 X&" 38 3(5/ 3EW 3 3r$   r@   c                   H     e Zd ZdZdZdddedededed	ee   f
 fd
Z xZ	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_colorNr   rE   rF   rG   rH   r   c                    t         |   |       || _        || _        || _        || _        | j                  | j                  | j                  | j
                  f| _        | j                          y r   )r   r   rE   rF   rG   rH   r   r   )r    rE   rF   rG   rH   r   r!   s         r"   r   z!UniqueGiftBackdropColors.__init__   sc     	J/!-)!-)++T__d>O>OQUQ`Q`ar$   )
r5   r6   r7   r8   r9   r;   r   r   r   r=   r>   s   @r"   rD   rD      sS    ,I *.  	
  X& r$   rD   c            
       n     e Zd ZdZdZdddedededee	   f fd	Z
edd
e	ded   dd f fd       Z xZS )UniqueGiftBackdropaX  This 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.

    )colorsr   r   Nr   r   rL   r   r   c                    t         |   |       || _        || _        || _        | j                  | j                  | j                  f| _        | j                          y r   )r   r   r   rL   r   r   r   )r    r   rL   r   r   r!   s        r"   r   zUniqueGiftBackdrop.__init__   sP     	J/	06%5))T[[$2G2GHr$   r%   r&   r   r'   c                     | j                  |      }t        |j                  d      t        |      |d<   t        |   ||      S )r*   rL   r+   )r-   r   r.   rD   r   r/   r0   s      r"   r/   zUniqueGiftBackdrop.de_json   sC     t$)$((8*<>VX[\XwDc22r$   r3   )r5   r6   r7   r8   r9   r:   rD   r;   r   r   r   r<   r/   r=   r>   s   @r"   rK   rK      sr    *I *. ) 	 X&" 38 3(5/ 3EY 3 3r$   rK   c                        e Zd ZdZdZ	 ddddedededed	ed
e	de
e   de
e   f fdZeddede
d   dd f fd       Z xZS )
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_namemodelr   numberpublisher_chatsymbolNr   rR   r   rT   rS   rV   rQ   rU   r   c                :   t         	|   |       || _        || _        || _        || _        || _        || _        || _        | j                  | j                  | j                  | j
                  | j                  | j                  f| _	        | j                          y r   )r   r   rR   r   rT   rS   rV   rQ   rU   r   r   )
r    rR   r   rT   rS   rV   rQ   rU   r   r!   s
            r"   r   zUniqueGift.__init__0  s     	J/'	!&+
(.,4.< NNIIKKJJKKMM
 	r$   r%   r&   r   r'   c                 `   | j                  |      }t        |j                  d      t        |      |d<   t        |j                  d      t        |      |d<   t        |j                  d      t
        |      |d<   t        |j                  d      t        |      |d<   t        | !  ||      S )r*   rS   rV   rQ   rU   r+   )	r-   r   r.   r   r@   rK   r   r   r/   r0   s      r"   r/   zUniqueGift.de_jsonP  s     t$('):OSQW)$((8*<>NPSTX+DHHZ,@BTVYZZ!1$((;K2LdTW!XwDc22r$   r3   )r5   r6   r7   r8   r9   r:   r;   r   r@   rK   r   r   r   r   r<   r/   r=   r>   s   @r"   rP   rP      s    &PI$ *. *.  	
  ! % ! X&@ 	38 	3(5/ 	3\ 	3 	3r$   rP   c                   l    e Zd ZU dZej
                  j                  Zee   e	d<   	 ej
                  j                  Z
ee   e	d<   	 ej
                  j                  Zee   e	d<   	 dZ	 	 	 	 dddded	ed
ee   dee   dee   deej"                     dee   f fdZeddeded   dd f fd       Z xZS )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
    UPGRADETRANSFERRESALE)giftlast_resale_star_countnext_transfer_dateoriginowned_gift_idtransfer_star_countNr   r^   ra   rb   rc   r_   r`   r   c                   t         |   |       || _        t        j                  t
        j                  ||      | _        || _        || _	        || _
        || _        | j                  | j                  f| _        | j                          y r   )r   r   r^   r
   
get_memberr   UniqueGiftInfoOriginra   rb   rc   r_   r`   r   r   )	r    r^   ra   rb   rc   r_   r`   r   r!   s	           r"   r   zUniqueGiftInfo.__init__  st     	J/ $	??9+I+I6SYZ,92E 5K#:L))T[[1r$   r%   r&   r   r'   c                     | j                  |      }t        |      }t        |j                  d      t        |      |d<   t        |j                  d      |      |d<   t        |   ||      S )r*   r^   r`   )tzinfor+   )r-   r   r   r.   rP   r   r   r/   )r1   r%   r&   
loc_tzinfor!   s       r"   r/   zUniqueGiftInfo.de_json  sl     t$1#6
'(8*cJV%3HH)*:&
!" wDc22r$   )NNNNr3   )r5   r6   r7   r8   r   rf   r[   r   r:   __annotations__r\   r]   r9   rP   r   r;   dtmdatetimer   r   r<   r/   r=   r>   s   @r"   rZ   rZ   ]  s   2h $88@@GU3Z@B$99BBHeCjBC"77>>FE#J>
I (,-10459 *.   }	
 &c] !) %S\\2 X&2 
38 
3(5/ 
3EU 
3 
3r$   rZ   )r8   rl   rk   typingr   r   r   telegramr   telegram._chatr   telegram._files.stickerr   telegram._telegramobjectr	   telegram._utilsr
   telegram._utils.argumentparsingr   telegram._utils.datetimer   r   telegram._utils.typesr   r   r   r@   rD   rK   rP   rZ    r$   r"   <module>rw      s   ( ;  1 1   + 3   < Q *43n 43n43~ 43n/~ /d43 43n]3 ]3@l3^ l3r$   