L iBdZddlZddlmZddlmZmZddlm Z ddl m Z ddl m Z ddlmZmZmZdd lmZmZdd lmZerdd lmZmZGd d e ZGdde ZGdde ZGdde Zy)zGThis module contains an objects that are related to Telegram giveaways.N)Sequence) TYPE_CHECKINGOptional)Chat)TelegramObject)User)de_json_optionalde_list_optionalparse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)BotMessageceZdZdZdZ ddddeedejde de e d e e d e e d e ee d e e d e e de e ffdZedde de dddffd ZxZS)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_codeshas_public_winnersonly_new_members premium_subscription_month_countprize_descriptionprize_star_count winner_countwinners_selection_dateN api_kwargsrrrrrrrrrrc 8t || t||_||_||_||_||_||_t||_ ||_ | |_ |j|j|j f|_ |jyNr)super__init__tuplerrrrrrr rrr _id_attrs_freeze) selfrrrrrrrrrr __class__s X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_giveaway.pyr!zGiveaway.__init__js J/',U| 4J#!-0@2D0A.@.O?_-/? JJ  ' '     databotrreturnc|j|}t|}t|jdt||d<t |jd||d<t |||S),See :meth:`telegram.TelegramObject.de_json`.rrtzinfor)r*) _parse_datar r getrr r de_jsonclsr)r* loc_tzinfor&s r'r3zGiveaway.de_jsonsnt$2#6 ('):D#FW )7 HH- .z*  %&wDc22r()NNNNNNN)__name__ __module__ __qualname____doc__ __slots__rrdtmdatetimeintrboolstrrr! classmethodr3 __classcell__r&s@r'rr$s7r I",0-1+/15:>*. *. ~ !$    #4.  %TN $C=   . +33- #3- X& D 38 3(5/ 3Z 3 3r(rcFeZdZdZdZ ddddeedeeffdZxZ S) GiveawayCreatedaThis 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 )rNrrrcTt||||_|jyr)r r!rr$)r%rrr&s r'r!zGiveawayCreated.__init__s& J//? r(r7) r8r9r:r;r<rr?rr!rCrDs@r'rFrFs? &I15Z^ ( EMhEWr(rFceZdZdZdZ ddddededejded e e d e ed e ed e ed e e de e de e de ede effdZeddede dddffd ZxZS)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_countchatgiveaway_message_idrrrrunclaimed_prize_count was_refundedrwinnersrNrrKrLrrrOrJrrMrrNrrrc |t|| ||_||_||_||_t ||_||_||_ ||_ | |_ | |_ | |_ | |_|j|j|j|j |jf|_|j!yr)r r!rKrLrrr"rOrJrrMrrNrrr#r$)r%rKrLrrrOrJrrMrrNrrrr&s r'r!zGiveawayWinners.__init__s" J/ (; 4J#!-).w 4I"?_-4I"0@,80A/? II  $ $  ' '    LL   r(r)r*rr+c(|j|}t|}t|jdt||d<t |jdt ||d<t|jd||d<t|%||S)r-rKrOrr.r0) r1r r r2rr rr r r3r4s r'r3zGiveawayWinners.de_json)st$2#6 '(8$DV *488I+>cJY)7 HH- .z*  %&wDc22r()NNNNNNNr7)r8r9r:r;r<rr?r=r>rrrr@rArr!rBr3rCrDs@r'rIrIs5n I,04:>/3+/'++/*.(*.((!(!$ (  ( $ ( (}(+33-( (}(#4.(tn($C=(#3-(X&(T 38 3(5/ 3EV 3 3r(rIc eZdZdZdZ ddddedeededd eed eef fd Z e dd ed edddffd Z xZ S)GiveawayCompletedasThis 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_messageis_star_giveawayrMrNrrrMrTrrUrct||||_||_||_||_|j|jf|_|jyr)r r!rrMrTrUr#r$)r%rrMrTrUrr&s r'r!zGiveawayCompleted.__init__Zs] J/!-4I"3C0@     & &  r(r)r*rr+c|j|}ddlm}t|j d|||d<t |||S)r-r)rrTr0)r1telegram._messagerr r2r r3)r5r)r*rr&s r'r3zGiveawayCompleted.de_jsonqsMt$ $4DHH=O4PRY[^#_  wDc22r()NNNr7) r8r9r:r;r<r?rr@rr!rBr3rCrDs@r'rSrS:s:bI 0404+/ *. (}#9-  #4. X&. 38 3(5/ 3EX 3 3r(rS)r;r>r=collections.abcrtypingrrtelegram._chatrtelegram._telegramobjectrtelegram._userrtelegram._utils.argumentparsingr r r telegram._utils.datetimer r telegram._utils.typesrtelegramrrrrFrIrSr(r'rcsg&N$*3bbQ*%u3~u3pn83n3DC3C3r(