§
    ¨eîi+B  ã                   ó  — d Z ddl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mZ dd	lmZmZ dd
lmZ erddlmZmZ  G d„ de
¦  «        Z G d„ de
¦  «        Z G d„ de
¦  «        Z G d„ de
¦  «        ZdS )zGThis module contains an objects that are related to Telegram giveaways.é    N)ÚSequence)ÚTYPE_CHECKING)ÚChat)ÚTelegramObject)ÚUser)Úde_json_optionalÚde_list_optionalÚparse_sequence_arg)Úextract_tzinfo_from_defaultsÚfrom_timestamp)ÚJSONDict)ÚBotÚMessagec                   óÚ   ‡ — e Zd ZdZdZ	 	 	 	 	 	 dddœdee         dej        de	de
dz  d	e
dz  d
edz  dee         dz  de	dz  de	dz  dedz  fˆ fd„Zeddedddd fˆ fd„¦   «         Zˆ xZS )ÚGiveawaya½  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.
        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
        premium_subscription_month_count (:obj:`int`, optional): The number of months the Telegram
            Premium subscription won from the giveaway will be active for; for Telegram Premium
            giveaways only.

    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.
        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
        premium_subscription_month_count (:obj:`int`): Optional. The number of months the Telegram
            Premium subscription won from the giveaway will be active for; for Telegram Premium
            giveaways only.
    )	ÚchatsÚcountry_codesÚhas_public_winnersÚonly_new_membersÚ premium_subscription_month_countÚprize_descriptionÚprize_star_countÚwinner_countÚwinners_selection_dateN©Ú
api_kwargsr   r   r   r   r   r   r   r   r   r   c
                óX  •— t          ¦   «                              |
¬¦  «         t          |¦  «        | _        || _        || _        || _        || _        || _        t          |¦  «        | _
        || _        |	| _        | j        | j        | j        f| _        |                      ¦   «          d S ©Nr   )ÚsuperÚ__init__Útupler   r   r   r   r   r   r
   r   r   r   Ú	_id_attrsÚ_freeze)Úselfr   r   r   r   r   r   r   r   r   r   Ú	__class__s              €úV/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/_giveaway.pyr    zGiveaway.__init__j   s¤   ø€ õ 	‰Œ×Ò JÐÑ/Ô/Ð/å',¨U¡|¤|ˆŒ
Ø4JˆÔ#Ø!-ˆÔØ-=ˆÔØ/AˆÔØ->ˆÔÝ.@ÀÑ.OÔ.OˆÔØ<\ˆÔ-Ø,<ˆÔð ŒJØÔ'ØÔð
ˆŒð 	�Š‰Œˆˆˆó    ÚdataÚbotú
Bot | NoneÚreturnc                 ó8  •— |                       |¦  «        }t          |¦  «        }t          |                     d¦  «        t          |¦  «        |d<   t          |                     d¦  «        |¬¦  «        |d<   t          ¦   «                              ||¬¦  «        S )ú,See :meth:`telegram.TelegramObject.de_json`.r   r   ©Útzinfo©r(   r)   )Ú_parse_datar   r	   Úgetr   r   r   Úde_json©Úclsr(   r)   Ú
loc_tzinfor%   s       €r&   r3   zGiveaway.de_jsonŒ   sŽ   ø€ ð �Š˜tÑ$Ô$ˆõ 2°#Ñ6Ô6ˆ
å(¨¯ª°'Ñ):Ô):½DÀ#ÑFÔFˆˆW‰Ý)7Ø�HŠHÐ-Ñ.Ô.°zð*
ñ *
ô *
ˆÐ%Ñ&õ ‰wŒw�Š D¨cˆÑ2Ô2Ð2r'   )NNNNNN©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   ÚdtmÚdatetimeÚintÚboolÚstrr   r    Úclassmethodr3   Ú__classcell__©r%   s   @r&   r   r   $   sE  ø€ € € € € ð7ð 7ðr
€Ið" )-Ø*.Ø(,Ø.2Ø7;Ø'+ð ð '+ð ð  ð  à˜Œ~ð ð !$¤ð ð ð	 ð
  ™+ð ð ! 4™Kð ð  ™:ð ð   ”} tÑ+ð ð +.°©*ð ð  ™*ð ð ˜t‘Oð ð  ð  ð  ð  ð  ðD ð3ð 3˜8ð 3¨,ð 3À*ð 3ð 3ð 3ð 3ð 3ñ „[ð3ð 3ð 3ð 3ð 3r'   r   c                   óD   ‡ — e Zd ZdZdZdddœdedz  dedz  fˆ fd„Zˆ xZS )	ÚGiveawayCreateda  This object represents a service message about the creation of a scheduled giveaway.

    Args:
        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

    Attributes:
        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

    )r   Nr   r   r   c                ó‚   •— t          ¦   «                              |¬¦  «         || _        |                      ¦   «          d S r   )r   r    r   r#   )r$   r   r   r%   s      €r&   r    zGiveawayCreated.__init__¯   s7   ø€ Ý‰Œ×Ò JÐÑ/Ô/Ð/Ø,<ˆÔà�Š‰Œˆˆˆr'   r7   )	r8   r9   r:   r;   r<   r?   r   r    rC   rD   s   @r&   rF   rF   œ   sw   ø€ € € € € ðð ð  &€IðÐ]að ð ð ¨¨t©ð È8ÐVZÉ?ð ð ð ð ð ð ð ð ð ð r'   rF   c                   óâ   ‡ — e Zd ZdZdZ	 	 	 	 	 	 	 dddœdededej        ded	e	e
         d
edz  dedz  dedz  dedz  dedz  dedz  dedz  dedz  fˆ fd„Zeddedddd fˆ fd„¦   «         Zˆ xZS )ÚGiveawayWinnersaË  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
        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
        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
        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
        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   r   Úunclaimed_prize_countÚwas_refundedr   Úwinnersr   Nr   rK   rL   r   r   rO   rJ   r   rM   r   rN   r   r   r   c                ó€  •— t          ¦   «                              |¬¦  «         || _        || _        || _        || _        t          |¦  «        | _        || _        || _	        || _
        |	| _        |
| _        || _        || _        | j        | j        | j        | j        | j        f| _        |                      ¦   «          d S r   )r   r    rK   rL   r   r   r!   rO   rJ   r   rM   r   rN   r   r   r"   r#   )r$   rK   rL   r   r   rO   rJ   r   rM   r   rN   r   r   r   r%   s                 €r&   r    zGiveawayWinners.__init__ý   s¾   ø€ õ" 	‰Œ×Ò JÐÑ/Ô/Ð/àˆŒ	Ø(;ˆÔ Ø4JˆÔ#Ø!-ˆÔÝ).¨w©¬ˆŒØ1FˆÔ"Ø<\ˆÔ-Ø1FˆÔ"Ø-=ˆÔØ)5ˆÔØ->ˆÔØ,<ˆÔð ŒIØÔ$ØÔ'ØÔØŒLð
ˆŒð 	�Š‰Œˆˆˆr'   r(   r)   r*   r+   c                 ó�  •— |                       |¦  «        }t          |¦  «        }t          |                     d¦  «        t          |¦  «        |d<   t          |                     d¦  «        t          |¦  «        |d<   t          |                     d¦  «        |¬¦  «        |d<   t          ¦   «          	                    ||¬¦  «        S )r-   rK   rO   r   r.   r0   )
r1   r   r   r2   r   r	   r   r   r   r3   r4   s       €r&   r3   zGiveawayWinners.de_json'  s¯   ø€ ð �Š˜tÑ$Ô$ˆõ 2°#Ñ6Ô6ˆ
å'¨¯ª°Ñ(8Ô(8½$ÀÑDÔDˆˆV‰Ý*¨4¯8ª8°IÑ+>Ô+>ÅÀcÑJÔJˆˆY‰Ý)7Ø�HŠHÐ-Ñ.Ô.°zð*
ñ *
ô *
ˆÐ%Ñ&õ ‰wŒw�Š D¨cˆÑ2Ô2Ð2r'   )NNNNNNNr7   )r8   r9   r:   r;   r<   r   r?   r=   r>   r   r   r@   rA   r   r    rB   r3   rC   rD   s   @r&   rI   rI   ¶   sf  ø€ € € € € ð5ð 5ðn€Ið, -1Ø7;Ø,0Ø(,Ø$(Ø(,Ø'+ð(ð '+ð(ð (ð (àð(ð !ð(ð !$¤ð	(ð
 ð(ð ˜$”ð(ð  # T™zð(ð +.°©*ð(ð  # T™zð(ð  ™+ð(ð ˜T‘kð(ð  ™:ð(ð  ™*ð(ð ˜t‘Oð(ð (ð (ð (ð (ð (ðT ð3ð 3˜8ð 3¨,ð 3ÐBSð 3ð 3ð 3ð 3ð 3ñ „[ð3ð 3ð 3ð 3ð 3r'   rI   c                   ó†   ‡ — e Zd ZdZdZ	 	 	 dddœdededz  ddd	edz  d
edz  f
ˆ fd„Ze	ddedddd fˆ fd„¦   «         Z
ˆ xZS )ÚGiveawayCompletedas  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
        is_star_giveaway (:obj:`bool`, optional): :obj:`True`, if the giveaway is a Telegram Star
            giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.

            .. versionadded:: 21.6
    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
        is_star_giveaway (:obj:`bool`): Optional. :obj:`True`, if the giveaway is a Telegram Star
            giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.

            .. versionadded:: 21.6
    )Úgiveaway_messageÚis_star_giveawayrM   r   Nr   r   rM   rT   zMessage | NonerU   r   c                óÒ   •— t          ¦   «                              |¬¦  «         || _        || _        || _        || _        | j        | j        f| _        |                      ¦   «          d S r   )r   r    r   rM   rT   rU   r"   r#   )r$   r   rM   rT   rU   r   r%   s         €r&   r    zGiveawayCompleted.__init__X  sj   ø€ õ 	‰Œ×Ò JÐÑ/Ô/Ð/à!-ˆÔØ1FˆÔ"Ø0@ˆÔØ-=ˆÔð ÔØÔ&ð
ˆŒð
 	�Š‰Œˆˆˆr'   r(   r)   r*   r+   c                 óÎ   •— |                       |¦  «        }ddlm} t          |                     d¦  «        ||¦  «        |d<   t          ¦   «                              ||¬¦  «        S )r-   r   )r   rT   r0   )r1   Útelegram._messager   r   r2   r   r3   )r5   r(   r)   r   r%   s       €r&   r3   zGiveawayCompleted.de_jsono  sv   ø€ ð �Š˜tÑ$Ô$ˆð	
ð 	
ð 	
ð 	
ð 	
ð 	
õ $4°D·H²HÐ=OÑ4PÔ4PÐRYÐ[^Ñ#_Ô#_ˆÐÑ å‰wŒw�Š D¨cˆÑ2Ô2Ð2r'   )NNNr7   )r8   r9   r:   r;   r<   r?   r@   r   r    rB   r3   rC   rD   s   @r&   rS   rS   8  sï   ø€ € € € € ðð ð: b€Ið
 -1Ø-1Ø(,ðð '+ðð ð àðð  # T™zðð +ð	ð
  ™+ðð ˜t‘Oðð ð ð ð ð ð. ð3ð 3˜8ð 3¨,ð 3ÐBUð 3ð 3ð 3ð 3ð 3ñ „[ð3ð 3ð 3ð 3ð 3r'   rS   )r;   r>   r=   Úcollections.abcr   Útypingr   Útelegram._chatr   Útelegram._telegramobjectr   Útelegram._userr   Útelegram._utils.argumentparsingr   r	   r
   Útelegram._utils.datetimer   r   Útelegram._utils.typesr   Útelegramr   r   r   rF   rI   rS   © r'   r&   ú<module>rc      sª  ðð& NÐ Mà Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø Ð Ð Ð Ð Ð Ø bÐ bÐ bÐ bÐ bÐ bÐ bÐ bÐ bÐ bØ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QØ *Ð *Ð *Ð *Ð *Ð *àð &Ø%Ð%Ð%Ð%Ð%Ð%Ð%Ð%ðu3ð u3ð u3ð u3ð u3ˆ~ñ u3ô u3ð u3ðpð ð ð ð �nñ ô ð ð43ð 3ð 3ð 3ð 3�nñ 3ô 3ð 3ðDC3ð C3ð C3ð C3ð C3˜ñ C3ô C3ð C3ð C3ð C3r'   