
    Yi?                     x   S r SSKJr  SSKJr  SSKJrJrJr  SSKJ	r	  SSK
Jr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJrJr  SSKJr  \(       a  SSKJr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r"g )!zDThis module contains the classes that represent Telegram ChatBoosts.    )Sequence)datetime)TYPE_CHECKINGFinalOptional)	constants)Chat)TelegramObject)User)enum)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc                   N   ^  \ rS rSrSrSrSS.S\S\\   SS4U 4S	 jjjr	S
r
U =r$ )ChatBoostAdded&   a  
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                p   > [         TU ]  US9  Xl        U R                  4U l        U R	                  5         g Nr   )super__init__r   	_id_attrs_freeze)selfr   r   	__class__s      >/app/.venv/lib/python3.13/site-packages/telegram/_chatboost.pyr   ChatBoostAdded.__init__:   s4     	J/ +**,    )r   r   )__name__
__module____qualname____firstlineno____doc__	__slots__intr   r   r   __static_attributes____classcell__r    s   @r!   r   r   &   s?    " !I *.	

 X&	

 

 
r#   r   c            	       D  ^  \ rS rSr% SrSr\R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    SS.S	\
S
\\   4U 4S jjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )ChatBoostSourceG   a<  
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   r1   r   c                   > [         TU ]  US9  [        R                  " [        R
                  X5      U l        U R                  4U l        U R                  5         g r   )	r   r   r   
get_memberr   ChatBoostSourcesr1   r   r   )r   r1   r   r    s      r!   r   ChatBoostSource.__init__h   sC    J/  ??9+E+EvV++r#   databotr   r   c                   > U R                  U5      nU(       d  gU R                  [        U R                  [        U R
                  [        0nU [        L a5  UR                  S5      U;   a   X1R                  S5         R                  XS9$ SU;   a)  [        R                  " UR                  S5      U5      US'   [        TU ])  XS9$ ),See :meth:`telegram.TelegramObject.de_json`.Nr1   r9   r:   user)_parse_datar2   ChatBoostSourcePremiumr3   ChatBoostSourceGiftCoder4   ChatBoostSourceGiveawayr/   getpopde_jsonr   r   )clsr9   r:   _class_mappingr    s       r!   rE   ChatBoostSource.de_jsonq   s    
 t$ KK/MM2LL1<
 /!dhhx&8N&J!((8"45==4=QQT><<(8#>DLwD22r#   )r   r1   N)r$   r%   r&   r'   r(   r)   r   r7   r2   r   str__annotations__r3   r4   r   r   r   classmethodrE   r+   r,   r-   s   @r!   r/   r/   G   s    . I#44<<GU3Z<>%66@@IuSz@@$55>>HeCj>?HL s 8H3E   >B3H%3,4UO3	#	$3 3r#   r/   c                   J   ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	Sr
U =r$ )	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U ]  U R                  US9  U R                  5          Xl        S S S 5        g ! , (       d  f       g = fN)r1   r   )r   r   r2   	_unfrozenr>   r   r>   r   r    s      r!   r   ChatBoostSourcePremium.__init__   s4    D^^"I 	   :
Ar$   r%   r&   r'   r(   r)   r   r   r   r   r+   r,   r-   s   @r!   r@   r@      s/     IGK #T #(82D # #r#   r@   c                   J   ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	Sr
U =r$ )	rA      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.
rO   Nr   r>   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        S S S 5        g ! , (       d  f       g = frQ   )r   r   r3   rR   r>   rS   s      r!   r    ChatBoostSourceGiftCode.__init__   s4    :F^^"I rU   rV   r-   s   @r!   rA   rA      s/      IGK #T #(82D # #r#   rA   c                   r   ^  \ rS rSrSrSr   SSS.S\S\\   S\\	   S	\\   S
\\
   4
U 4S jjjjrSrU =r$ )rB      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_unclaimedprize_star_countr>   Nr   r]   r>   r^   r_   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        X l        X@l        X0l        S S S 5        g ! , (       d  f       g = frQ   )r   r   r4   rR   r]   r>   r_   r^   )r   r]   r>   r^   r_   r   r    s         r!   r    ChatBoostSourceGiveaway.__init__   sH     	*E^^,?$(,I3C!0<	 s   A
A)NNN)r$   r%   r&   r'   r(   r)   r*   r   r   boolr   r   r+   r,   r-   s   @r!   rB   rB      sq     D TI
  $'+*.= *.= = tn= tn	=
 #3-= X&= =r#   rB   c                      ^  \ rS rSrSrSrSS.S\S\S\S	\S
\	\
   4
U 4S jjjr\ SS\	\
   S\	S   S\	S    4U 4S jjj5       rSrU =r$ )	ChatBoost   a  
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_dater1   Nr   rg   rf   rh   r1   r   c                   > [         TU ]  US9  Xl        X l        X0l        X@l        U R                  U R                  U R                  U R
                  4U l        U R                  5         g r   )r   r   rg   rf   rh   r1   r   r   )r   rg   rf   rh   r1   r   r    s         r!   r   ChatBoost.__init__  sU     	J/%"*)8'---8L8LdkkZr#   r9   r:   r   r   c                    > U R                  U5      nU(       d  g[        R                  UR                  S5      U5      US'   [	        U5      n[        US   US9US'   [        US   US9US'   [        TU ]	  XS9$ )r<   Nr1   rf   tzinforh   r=   )r?   r/   rE   rC   r   r   r   rF   r9   r:   
loc_tzinfor    s       r!   rE   ChatBoost.de_json%  s    
 t$(00(1CSIX1#6
)$z*::NZ"06G1HQ["\wD22r#   )r   rf   rg   rh   r1   rI   )r$   r%   r&   r'   r(   r)   rJ   r   r/   r   r   r   rL   rE   r+   r,   r-   s   @r!   rd   rd      s    6 FI *.  "	
   X& & >B3H%3,4UO3	+	3 3r#   rd   c            	          ^  \ rS rSrSrSrSS.S\S\S\\	   4U 4S	 jjjr
\ SS
\\	   S\S   S\S    4U 4S jjj5       rSrU =r$ )ChatBoostUpdatedi7  a  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   rt   rs   r   c                   > [         TU ]  US9  Xl        X l        U R                  R                  U R                  4U l        U R                  5         g r   )r   r   rt   rs   idr   r   )r   rt   rs   r   r    s       r!   r   ChatBoostUpdated.__init__J  s@     	J/	 %
)),,

3r#   r9   r:   r   r   c                    > U R                  U5      nU(       d  g[        R                  " UR                  S5      U5      US'   [        R                  UR                  S5      U5      US'   [
        TU ]	  XS9$ )r<   Nrt   rs   r=   )r?   r	   rE   rC   rd   r   rF   r9   r:   r    s      r!   rE   ChatBoostUpdated.de_jsonY  sf    
 t$||DHHV$4c:V!))$((7*;SAWwD22r#   )r   rs   rt   rI   )r$   r%   r&   r'   r(   r)   r	   rd   r   r   r   rL   rE   r+   r,   r-   s   @r!   rr   rr   7  s}      "I *. 
 X&  >B3H%3,4UO3	$	%3 3r#   rr   c                      ^  \ rS rSrSrSrSS.S\S\S\S	\	S
\
\   4
U 4S jjjr\ SS\
\   S\
S   S\
S    4U 4S jjj5       rSrU =r$ )ChatBoostRemovedii  ac  
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.
)rg   rt   remove_dater1   Nr   rt   rg   r}   r1   r   c                   > [         TU ]  US9  Xl        X l        X0l        X@l        U R                  U R                  U R                  U R
                  4U l        U R                  5         g r   )r   r   rt   rg   r}   r1   r   r   )r   rt   rg   r}   r1   r   r    s         r!   r   ChatBoostRemoved.__init__  sU     	J/	%%0'-))T]]D4D4DdkkRr#   r9   r:   r   r   c                 (  > U R                  U5      nU(       d  g[        R                  " UR                  S5      U5      US'   [        R                  UR                  S5      U5      US'   [        U5      n[        US   US9US'   [        TU ]	  XS9$ )r<   Nrt   r1   r}   rl   r=   )r?   r	   rE   rC   r/   r   r   r   rn   s       r!   rE   ChatBoostRemoved.de_json  s    
 t$||DHHV$4c:V(00(1CSIX1#6
,T--@T]wD22r#   )r   rg   rt   r}   r1   rI   )r$   r%   r&   r'   r(   r)   r	   rJ   r   r/   r   r   r   rL   rE   r+   r,   r-   s   @r!   r|   r|   i  s    * >I *.  	
   X& & >B3H%3,4UO3	$	%3 3r#   r|   c            	          ^  \ rS rSrSrSrSS.S\\   S\\	   4U 4S jjjr
\ SS	\\	   S
\S   S\S    4U 4S jjj5       rSrU =r$ )UserChatBoostsi  a  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   r   r   c                   > [         TU ]  US9  [        U5      U l        U R                  4U l        U R                  5         g r   )r   r   r   r   r   r   )r   r   r   r    s      r!   r   UserChatBoosts.__init__  s7     	J/-?-G++r#   r9   r:   r   r   c                    > U R                  U5      nU(       d  g[        R                  UR                  S5      U5      US'   [        TU ]  XS9$ )r<   Nr   r=   )r?   rd   de_listrC   r   rE   ry   s      r!   rE   UserChatBoosts.de_json  sI    
 t$"**488H+=sCXwD22r#   )r   r   rI   )r$   r%   r&   r'   r(   r)   r   rd   r   r   r   rL   rE   r+   r,   r-   s   @r!   r   r     sx     I *.	# X&	  >B3H%3,4UO3	"	#3 3r#   r   N)#r(   collections.abcr   r   typingr   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@   rA   rB   rd   rr   r|   r    r#   r!   <module>r      s   & K $  1 1   3    > Q *^ B@3n @3F#_ #2#o #44=o 4=n@3 @3F/3~ /3d:3~ :3z+3^ +3r#   