
    Ii:                         S r SSKrSSKJr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Jr  SS	KJr  \(       a  SS
KJrJr   " S S\
5      r " S S\
5      r " S S\
5      r " S S\
5      rg)zGThis module contains an objects that are related to Telegram giveaways.    N)TYPE_CHECKINGOptionalSequenceTuple)Chat)TelegramObject)User)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)BotMessagec                      ^  \ rS rSrSrSr     SSS.S\\   S\R                  S\	S	\
\   S
\
\   S\
\   S\
\\      S\
\	   S\
\   4U 4S jjjjr\S\
\   SSS\
S    4U 4S jj5       rSrU =r$ )Giveaway"   a+  This object represents a message about a scheduled giveaway.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`chats`, :attr:`winners_selection_date` and
:attr:`winner_count` are equal.

.. versionadded:: 20.8

Args:
    chats (Tuple[:class:`telegram.Chat`]): The list of chats which the user must join to
        participate in the giveaway.
    winners_selection_date (:class:`datetime.datetime`): The date when the giveaway winner will
        be selected. |datetime_localization|
    winner_count (:obj:`int`): The number of users which are supposed to be selected as winners
        of the giveaway.
    only_new_members (:obj:`True`, optional): If :obj:`True`, only users who join the chats
        after the giveaway started should be eligible to win.
    has_public_winners (:obj:`True`, optional): :obj:`True`, if the list of giveaway winners
        will be visible to everyone
    prize_description (:obj:`str`, optional): Description of additional giveaway prize
    country_codes (Sequence[:obj:`str`]): A list of two-letter ISO 3166-1 alpha-2
        country codes indicating the countries from which eligible users for the giveaway must
        come. If empty, then all users can participate in the giveaway. Users with a phone
        number that was bought on Fragment can always participate in giveaways.
    premium_subscription_month_count (:obj:`int`, optional): The number of months the Telegram
        Premium subscription won from the giveaway will be active for.

Attributes:
    chats (Sequence[:class:`telegram.Chat`]): The list of chats which the user must join to
        participate in the giveaway.
    winners_selection_date (:class:`datetime.datetime`): The date when the giveaway winner will
        be selected. |datetime_localization|
    winner_count (:obj:`int`): The number of users which are supposed to be selected as winners
        of the giveaway.
    only_new_members (:obj:`True`): Optional. If :obj:`True`, only users who join the chats
        after the giveaway started should be eligible to win.
    has_public_winners (:obj:`True`): Optional. :obj:`True`, if the list of giveaway winners
        will be visible to everyone
    prize_description (:obj:`str`): Optional. Description of additional giveaway prize
    country_codes (Tuple[:obj:`str`]): Optional. A tuple of two-letter ISO 3166-1 alpha-2
        country codes indicating the countries from which eligible users for the giveaway must
        come. If empty, then all users can participate in the giveaway. Users with a phone
        number that was bought on Fragment can always participate in giveaways.
    premium_subscription_month_count (:obj:`int`): Optional. The number of months the Telegram
        Premium subscription won from the giveaway will be active for.
)chatscountry_codeshas_public_winnersonly_new_members premium_subscription_month_countprize_descriptionwinner_countwinners_selection_dateN
api_kwargsr   r   r   r   r   r   r   r   r   c	                  > [         T
U ]  U	S9  [        U5      U l        X l        X0l        X@l        XPl        X`l        [        U5      U l
        Xl        U R                  U R                  U R
                  4U l        U R                  5         g Nr   )super__init__tupler   r   r   r   r   r   r
   r   r   	_id_attrs_freeze)selfr   r   r   r   r   r   r   r   r   	__class__s             8/venv/lib/python3.13/site-packages/telegram/_giveaway.pyr    Giveaway.__init__]   s     	J/',U|
9O#!-0@2D0A.@.O?_- JJ''
 	    databotr   returnc                    > U R                  U5      nUc  g[        U5      n[        [        R                  " UR                  S5      U5      5      US'   [        UR                  S5      US9US'   [        TU ]!  XS9$ )+See :obj:`telegram.TelegramObject.de_json`.Nr   r   tzinfor)   r*   )	_parse_datar   r!   r   de_listgetr   r   de_jsonclsr)   r*   
loc_tzinfor%   s       r&   r4   Giveaway.de_json}   s{     t$< 2#6
dll488G+<cBCW)7HH-.z*
%& wD22r(   )	r"   r   r   r   r   r   r   r   r   )NNNNN)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   datetimeintr   boolstrr   r    classmethodr4   __static_attributes____classcell__r%   s   @r&   r   r   "   s    -^	I  ,0-1+/15:> *.~ !) 1 1 	
 #4. %TN $C=  . +33- X& @ 38H- 3E 3hz>R 3 3r(   r   c                   F   ^  \ rS rSrSrSrSS.S\\   4U 4S jjjrSr	U =r
$ )GiveawayCreated   zuThis object represents a service message about the creation of a scheduled giveaway.
Currently holds no information.
 Nr   r   c                @   > [         TU ]  US9  U R                  5         g r   )r   r    r#   )r$   r   r%   s     r&   r    GiveawayCreated.__init__   s    J/r(   )r9   r:   r;   r<   r=   r>   r   r   r    rD   rE   rF   s   @r&   rH   rH      s(     I;? hx&8  r(   rH   c                      ^  \ rS rSrSrSr      SSS.S\S\S\R                  S	\S
\	\
   S\\   S\\   S\\   S\\   S\\   S\\   S\\   4U 4S jjjjr\S\\   SSS\S    4U 4S jj5       rSrU =r$ )GiveawayWinners   a  This object represents a message about the completion of a giveaway with public winners.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`chat`, :attr:`giveaway_message_id`,
:attr:`winners_selection_date`, :attr:`winner_count` and :attr:`winners` are equal.

.. versionadded:: 20.8

Args:
    chat (:class:`telegram.Chat`): The chat that created the giveaway
    giveaway_message_id (:obj:`int`): Identifier of the message with the giveaway in the chat
    winners_selection_date (:class:`datetime.datetime`): Point in time when winners of the
        giveaway were selected. |datetime_localization|
    winner_count (:obj:`int`): Total number of winners in the giveaway
    winners (Sequence[:class:`telegram.User`]): List of up to
        :tg-const:`telegram.constants.GiveawayLimit.MAX_WINNERS` winners of the giveaway
    additional_chat_count (:obj:`int`, optional): The number of other chats the user had to
        join in order to be eligible for the giveaway
    premium_subscription_month_count (:obj:`int`, optional): The number of months the Telegram
        Premium subscription won from the giveaway will be active for
    unclaimed_prize_count (:obj:`int`, optional): Number of undistributed prizes
    only_new_members (:obj:`True`, optional): :obj:`True`, if only users who had joined the
        chats after the giveaway started were eligible to win
    was_refunded (:obj:`True`, optional): :obj:`True`, if the giveaway was canceled because the
        payment for it was refunded
    prize_description (:obj:`str`, optional): Description of additional giveaway prize

Attributes:
    chat (:class:`telegram.Chat`): The chat that created the giveaway
    giveaway_message_id (:obj:`int`): Identifier of the message with the giveaway in the chat
    winners_selection_date (:class:`datetime.datetime`): Point in time when winners of the
        giveaway were selected. |datetime_localization|
    winner_count (:obj:`int`): Total number of winners in the giveaway
    winners (Tuple[:class:`telegram.User`]): tuple of up to
        :tg-const:`telegram.constants.GiveawayLimit.MAX_WINNERS` winners of the giveaway
    additional_chat_count (:obj:`int`): Optional. The number of other chats the user had to
        join in order to be eligible for the giveaway
    premium_subscription_month_count (:obj:`int`): Optional. The number of months the Telegram
        Premium subscription won from the giveaway will be active for
    unclaimed_prize_count (:obj:`int`): Optional. Number of undistributed prizes
    only_new_members (:obj:`True`): Optional. :obj:`True`, if only users who had joined the
        chats after the giveaway started were eligible to win
    was_refunded (:obj:`True`): Optional. :obj:`True`, if the giveaway was canceled because the
        payment for it was refunded
    prize_description (:obj:`str`): Optional. Description of additional giveaway prize
)additional_chat_countchatgiveaway_message_idr   r   r   unclaimed_prize_countwas_refundedr   winnersr   Nr   rQ   rR   r   r   rU   rP   r   rS   r   rT   r   r   c                T  > [         TU ]  US9  Xl        X l        X0l        X@l        [        U5      U l        X`l        Xpl	        Xl
        Xl        Xl        Xl        U R                  U R                  U R                  U R
                  U R                  4U l        U R                  5         g r   )r   r    rQ   rR   r   r   r!   rU   rP   r   rS   r   rT   r   r"   r#   )r$   rQ   rR   r   r   rU   rP   r   rS   r   rT   r   r   r%   s                r&   r    GiveawayWinners.__init__   s      	J/	(; 9O#!-).w4I"?_-4I"0@,80A II$$''LL
 	r(   r)   r*   r   r+   c                 L  > U R                  U5      nUc  g[        U5      n[        R                  " UR	                  S5      U5      US'   [        [        R                  " UR	                  S5      U5      5      US'   [        UR	                  S5      US9US'   [        TU ]  XS9$ )r-   NrQ   rU   r   r.   r0   )
r1   r   r   r4   r3   r!   r	   r2   r   r   r5   s       r&   r4   GiveawayWinners.de_json  s     t$< 2#6
||DHHV$4c:VTXXi-@# FGY)7HH-.z*
%& wD22r(   )r"   rP   rQ   rR   r   r   r   rS   rT   r   rU   r   )NNNNNN)r9   r:   r;   r<   r=   r>   r   r@   r?   r   r	   r   rA   rB   r   r    rC   r4   rD   rE   rF   s   @r&   rN   rN      s
   -^I* 04:>/3+/'++/& *.&& !& !) 1 1	&
 & $&  (}& +33-&  (}& #4.& tn& $C=& X&& &P 38H- 3E 3hGX>Y 3 3r(   rN   c                      ^  \ 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\\   SSS\S    4U 4S jj5       rSrU =r$ )GiveawayCompletedi  az  This object represents a service message about the completion of a giveaway without public
winners.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`winner_count` and :attr:`unclaimed_prize_count` are equal.

.. versionadded:: 20.8


Args:
    winner_count (:obj:`int`): Number of winners in the giveaway
    unclaimed_prize_count (:obj:`int`, optional): Number of undistributed prizes
    giveaway_message (:class:`telegram.Message`, optional): Message with the giveaway that was
        completed, if it wasn't deleted

Attributes:
    winner_count (:obj:`int`): Number of winners in the giveaway
    unclaimed_prize_count (:obj:`int`): Optional. Number of undistributed prizes
    giveaway_message (:class:`telegram.Message`): Optional. Message with the giveaway that was
        completed, if it wasn't deleted
)giveaway_messagerS   r   Nr   r   rS   r\   r   r   c                   > [         TU ]  US9  Xl        X l        X0l        U R                  U R                  4U l        U R                  5         g r   )r   r    r   rS   r\   r"   r#   )r$   r   rS   r\   r   r%   s        r&   r    GiveawayCompleted.__init__0  sO     	J/!-4I"5E &&

 	r(   r)   r*   r   r+   c                    > U R                  U5      nUc  gSSKJn  UR                  " UR	                  S5      U5      US'   [
        TU ]  XS9$ )r-   Nr   )r   r\   r0   )r1   telegram._messager   r4   r3   r   )r6   r)   r*   r   r%   s       r&   r4   GiveawayCompleted.de_jsonE  sR     t$< 	.#*??488<N3OQT#U wD22r(   )r"   r\   rS   r   )NN)r9   r:   r;   r<   r=   r>   r@   r   r   r    rC   r4   rD   rE   rF   s   @r&   r[   r[     s    , NI
 0404	 *.  (} #9-	 X& * 38H- 3E 3hGZ>[ 3 3r(   r[   )r=   r?   typingr   r   r   r   telegram._chatr   telegram._telegramobjectr   telegram._userr	   telegram._utils.argumentparsingr
   telegram._utils.datetimer   r   telegram._utils.typesr   telegramr   r   r   rH   rN   r[   rJ   r(   r&   <module>rj      sb   & N  ; ;  3  > Q *%k3~ k3\
n 
w3n w3t;3 ;3r(   