
    iv<                        d Z ddlmZ ddlmZmZmZmZ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! G d de          Z" G d de          Z# G d de          Z$dS ) zDThis module contains the classes that represent Telegram ChatBoosts.    )datetime)TYPE_CHECKINGDictFinalOptionalSequenceTupleType)	constants)Chat)TelegramObject)User)enum)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc                   F     e Zd ZdZdZdddedee         ddf fdZ xZ	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_kwargsr   r   returnc                    t                                          |           || _        | j        f| _        |                                  d S Nr   )super__init__r   	_id_attrs_freeze)selfr   r   	__class__s      Y/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/telegram/_chatboost.pyr   zChatBoostAdded.__init__9   sF     	J/// +*,    )
__name__
__module____qualname____doc__	__slots__intr   r   r   __classcell__r"   s   @r#   r   r   %   s~         " !I *.	
 
 

 X&	

 

 
 
 
 
 
 
 
 
 
r$   r   c                       e Zd ZU dZ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dde	d	ee         f fd
Zedee         ddded          f fd            Z xZS )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`.
    )sourcePREMIUM	GIFT_CODEGIVEAWAYNr   r/   r   c                    t                                          |           t          j        t          j        ||          | _        | j        f| _        |                                  d S r   )	r   r   r   
get_memberr   ChatBoostSourcesr/   r   r    )r!   r/   r   r"   s      r#   r   zChatBoostSource.__init__g   sT    J///  ?9+EvvVV+r$   databotr   r   c                    |                      |          }|sdS | j        t          | j        t          | j        t          i}| t          u rG|                    d          |v r0||	                    d                   
                    ||          S d|v r+t          j
        |                    d          |          |d<   t                      
                    ||          S ),See :meth:`telegram.TelegramObject.de_json`.Nr/   r6   r7   user)_parse_datar0   ChatBoostSourcePremiumr1   ChatBoostSourceGiftCoder2   ChatBoostSourceGiveawayr.   getpopde_jsonr   r   )clsr6   r7   _class_mappingr"   s       r#   rB   zChatBoostSource.de_jsonp   s     t$$ 	4 K/M2L1<
 /!!dhhx&8&8N&J&J!$((8"4"45==4S=QQQT>><(8(8#>>DLwwDc222r$   )r%   r&   r'   r(   r)   r   r5   r0   r   str__annotations__r1   r2   r   r   r   classmethodrB   r+   r,   s   @r#   r.   r.   F   s         . I#4<GU3Z<<<>%6@IuSz@@@@$5>HeCj>>>?HL   s 8H3E       38H- 3E 3hGX>Y 3 3 3 3 3 [3 3 3 3 3r$   r.   c                   B     e Zd ZdZdZdddedee         f fdZ xZ	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.
    r;   Nr   r;   r   c                    t                                          | j        |           |                                 5  || _        d d d            d S # 1 swxY w Y   d S N)r/   r   )r   r   r0   	_unfrozenr;   r!   r;   r   r"   s      r#   r   zChatBoostSourcePremium.__init__   s    DDD^^ 	# 	#"DI	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#   AAA
r%   r&   r'   r(   r)   r   r   r   r   r+   r,   s   @r#   r=   r=      sn          IGK # # #T #(82D # # # # # # # # # #r$   r=   c                   B     e Zd ZdZdZdddedee         f fdZ xZ	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.
    rI   Nr   r;   r   c                    t                                          | j        |           |                                 5  || _        d d d            d S # 1 swxY w Y   d S rK   )r   r   r1   rL   r;   rM   s      r#   r   z ChatBoostSourceGiftCode.__init__   s    :FFF^^ 	# 	#"DI	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#rN   rO   r,   s   @r#   r>   r>      sn           IGK # # #T #(82D # # # # # # # # # #r$   r>   c                   h     e Zd ZdZdZ	 	 d
dddedee         dee         dee	         f fd	Z
 xZS )r?   a  
    The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4
    times for the duration of the corresponding Telegram Premium subscription.

    .. 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.
        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.
        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_unclaimedr;   Nr   rS   r;   rT   r   c                    t                                          | j        |           |                                 5  || _        || _        || _        d d d            d S # 1 swxY w Y   d S rK   )r   r   r2   rL   rS   r;   rT   )r!   rS   r;   rT   r   r"   s        r#   r   z ChatBoostSourceGiveaway.__init__   s     	*EEE^^ 	= 	=,?D$(,DI0<D	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=s   A!!A%(A%)NN)r%   r&   r'   r(   r)   r*   r   r   boolr   r   r+   r,   s   @r#   r?   r?      s         . @I
  $'+	= *.= = = = tn= tn	= X&= = = = = = = = = =r$   r?   c                        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
edee	         ddded          f fd            Z xZS )	ChatBoosta  
    This object contains information about a chat boost.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`boost_id`, :attr:`add_date`, :attr:`expiration_date`,
    and :attr:`source` are equal.

    .. versionadded:: 20.8

    Args:
        boost_id (:obj:`str`): Unique identifier of the boost.
        add_date (:obj:`datetime.datetime`): Point in time when the chat was boosted.
        expiration_date (:obj:`datetime.datetime`): Point in time when the boost
            will automatically expire, unless the booster's Telegram Premium subscription is
            prolonged.
        source (:class:`telegram.ChatBoostSource`): Source of the added boost.

    Attributes:
        boost_id (:obj:`str`): Unique identifier of the boost.
        add_date (:obj:`datetime.datetime`): Point in time when the chat was boosted.
            |datetime_localization|
        expiration_date (:obj:`datetime.datetime`): Point in time when the boost
            will automatically expire, unless the booster's Telegram Premium subscription is
            prolonged. |datetime_localization|
        source (:class:`telegram.ChatBoostSource`): Source of the added boost.
    )add_dateboost_idexpiration_dater/   Nr   rZ   rY   r[   r/   r   c                    t                                          |           || _        || _        || _        || _        | j        | j        | j        | j        f| _        |                                  d S r   )r   r   rZ   rY   r[   r/   r   r    )r!   rZ   rY   r[   r/   r   r"   s         r#   r   zChatBoost.__init__  sg     	J///%"*)8'--8LdkZr$   r6   r7   r   r   c                 d   |                      |          }|sdS t                              |                    d          |          |d<   t	          |          }t          |d         |          |d<   t          |d         |          |d<   t                                          ||          S )r9   Nr/   rY   tzinfor[   r:   )r<   r.   rB   r@   r   r   r   rC   r6   r7   
loc_tzinfor"   s       r#   rB   zChatBoost.de_json  s     t$$ 	4(00(1C1CSIIX1#66
)$z*::NNNZ"06G1HQ["\"\"\wwDc222r$   )r%   r&   r'   r(   r)   rE   r   r.   r   r   r   rG   rB   r+   r,   s   @r#   rX   rX      s         6 FI *.    "	
   X&     & 38H- 3E 3h{>S 3 3 3 3 3 [3 3 3 3 3r$   rX   c                        e Zd ZdZdZdddededee         f fdZ	e
d	ee         d
dded          f fd            Z xZ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.
    )boostchatNr   re   rd   r   c                    t                                          |           || _        || _        | j        j        | j        f| _        |                                  d S r   )r   r   re   rd   idr   r    )r!   re   rd   r   r"   s       r#   r   zChatBoostUpdated.__init__8  sQ     	J///	 %
),
3r$   r6   r7   r   r   c                 4   |                      |          }|sdS t          j        |                    d          |          |d<   t                              |                    d          |          |d<   t                                          ||          S )r9   Nre   rd   r:   )r<   r   rB   r@   rX   r   rC   r6   r7   r"   s      r#   rB   zChatBoostUpdated.de_jsonG  s     t$$ 	4|DHHV$4$4c::V!))$((7*;*;SAAWwwDc222r$   )r%   r&   r'   r(   r)   r   rX   r   r   r   rG   rB   r+   r,   s   @r#   rc   rc   %  s           "I *.   
 X&      
38H- 
3E 
3hGY>Z 
3 
3 
3 
3 
3 [
3 
3 
3 
3 
3r$   rc   c                        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ede	e
         ddde	d          f fd            Z xZS )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.
    )rZ   re   remove_dater/   Nr   re   rZ   rl   r/   r   c                    t                                          |           || _        || _        || _        || _        | j        | j        | j        | j        f| _        |                                  d S r   )r   r   re   rZ   rl   r/   r   r    )r!   re   rZ   rl   r/   r   r"   s         r#   r   zChatBoostRemoved.__init__m  sg     	J///	%%0'-)T]D4DdkRr$   r6   r7   r   r   c                    |                      |          }|sdS t          j        |                    d          |          |d<   t                              |                    d          |          |d<   t          |          }t          |d         |          |d<   t                                          ||          S )r9   Nre   r/   rl   r^   r:   )r<   r   rB   r@   r.   r   r   r   r`   s       r#   rB   zChatBoostRemoved.de_json  s     t$$ 	4|DHHV$4$4c::V(00(1C1CSIIX1#66
,T--@TTT]wwDc222r$   )r%   r&   r'   r(   r)   r   rE   r   r.   r   r   r   rG   rB   r+   r,   s   @r#   rk   rk   U  s         * >I *.    	
   X&     & 38H- 3E 3hGY>Z 3 3 3 3 3 [3 3 3 3 3r$   rk   c                        e Zd ZdZdZdddee         dee         f fdZ	e
dee         d	d
ded          f fd            Z xZS )UserChatBoostsa  This 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.
    )boostsNr   rq   r   c                    t                                          |           t          |          | _        | j        f| _        |                                  d S r   )r   r   r   rq   r   r    )r!   rq   r   r"   s      r#   r   zUserChatBoosts.__init__  sK     	J///-?-G-G+r$   r6   r7   r   r   c                     |                      |          }|sdS t                              |                    d          |          |d<   t	                                          ||          S )r9   Nrq   r:   )r<   rX   de_listr@   r   rB   ri   s      r#   rB   zUserChatBoosts.de_json  sb     t$$ 	4"**488H+=+=sCCXwwDc222r$   )r%   r&   r'   r(   r)   r   rX   r   r   r   rG   rB   r+   r,   s   @r#   rp   rp     s          I *.	  # X&	      	38H- 	3E 	3hGW>X 	3 	3 	3 	3 	3 [	3 	3 	3 	3 	3r$   rp   N)%r(   r   typingr   r   r   r   r   r	   r
   telegramr   telegram._chatr   telegram._telegramobjectr   telegram._userr   telegram._utilsr   telegram._utils.argumentparsingr   telegram._utils.datetimer   r   telegram._utils.typesr   r   r   r.   r=   r>   r?   rX   rc   rk   rp    r$   r#   <module>r      s  & K J       N N N N N N N N N N N N N N N N N N             3 3 3 3 3 3                   > > > > > > Q Q Q Q Q Q Q Q * * * * * *     ^   B>3 >3 >3 >3 >3n >3 >3 >3B# # # # #_ # # #2# # # # #o # # #4'= '= '= '= '=o '= '= '=T>3 >3 >3 >3 >3 >3 >3 >3B-3 -3 -3 -3 -3~ -3 -3 -3`83 83 83 83 83~ 83 83 83v)3 )3 )3 )3 )3^ )3 )3 )3 )3 )3r$   