
    i4                         S SK r S SKJr  S SKJrJrJr  S SKrS SKJrJrJ	r	J
r
  \ R                  " \5      r " S S5      rg)    N)datetime)ListOptionalUnion)enumsrawtypesutilsc            G          \ rS rSrS\R
                  R                  SSSSSSSSSSSSSSSSSSSSSSSSSSSS4SSS\\\	4   S\	S\
\	   S	\S
SS\\   S\\   S\S   S\\
S      S\\	   S\S   S\\
S      S\\   S\\   S\\   S\\   S\\   S\\   S\\   S\S   S\\   S\\   S \\	   S!\S   S"\S#\S$\\S%      S&\\   S'\\\\	4      S(\\	   S)\S   S*\\
S      S+\\   S,S-4FS. jjrS/rg)0SendPoll   TNselfzpyrogram.Clientchat_idquestionoptionsis_anonymoustypezenums.PollTypeallows_multiple_answerscorrect_option_idquestion_parse_modezenums.ParseModequestion_entitiesztypes.MessageEntityexplanationexplanation_parse_modeexplanation_entitiesopen_period
close_date	is_closeddisable_notificationprotect_contentmessage_thread_id	effect_idreply_parametersztypes.ReplyParametersschedule_daterepeat_periodbusiness_connection_idoptions_parse_modeallow_paid_broadcastpaid_message_star_countreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyreply_to_message_idreply_to_chat_id
quote_textquote_parse_modequote_entitiesquote_offsetreturnztypes.Messagec"                 :  #    [        USLUSLUSLUSLU SLU!SL45      (       a  Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        U b  [        R                  S5        U!b  [        R                  S5        [        R                  " UUUUU U!S9n[
        R                  " XX5      I Sh  vN R                  5       u  p)[
        R                  " X
X5      I Sh  vN R                  5       u  n"n#/ n$[        U5       H  u  n%n&[
        R                  " U U&US5      I Sh  vN R                  5       u  n'n(U$R                  [        R                  R                  [        R                  R                  U'U(=(       d    / S	9[        U%/5      S
95        M     U R                  [        R                  R                   R#                  U R%                  U5      I Sh  vN [        R                  R'                  [        R                  R)                  U R+                  5       [        R                  R                  UU	=(       d    / S	9U$UU(       + UU[,        R.                  R0                  :H  =(       d    SU[
        R2                  " U5      S9	Ub  [        U/5      /OSU"U#=(       d    / S9SU[
        R4                  " U UU5      I Sh  vN U R+                  5       [
        R2                  " U5      UUUUU(       a  UR7                  U 5      I Sh  vN OSUS9US9I Sh  vN n)[
        R8                  " U U)S9I Sh  vN n*U*(       a  U*S   $ S$  GN GNs GN1 GN| N NM N? N$7f)a  Send a new poll.

.. include:: /_includes/usable-by/users-bots.rst

Parameters:
    chat_id (``int`` | ``str``):
        Unique identifier (int) or username (str) of the target chat.
        For your personal cloud (Saved Messages) you can simply use "me" or "self".
        For a contact that exists in your Telegram address book you can use his phone number (str).

    question (``str``):
        Poll question, 1-255 characters.

    options (List of ``str``):
        List of answer options, 2-12 strings 1-100 characters each.

    is_anonymous (``bool``, *optional*):
        True, if the poll needs to be anonymous.
        Defaults to True.

    type (:obj`~pyrogram.enums.PollType`, *optional*):
        Poll type, :obj:`~pyrogram.enums.PollType.QUIZ` or :obj:`~pyrogram.enums.PollType.REGULAR`.
        Defaults to :obj:`~pyrogram.enums.PollType.REGULAR`.

    allows_multiple_answers (``bool``, *optional*):
        True, if the poll allows multiple answers, ignored for polls in quiz mode.
        Defaults to False.

    correct_option_id (``int``, *optional*):
        0-based identifier of the correct answer option, required for polls in quiz mode.

    question_parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
        By default, texts are parsed using both Markdown and HTML styles.
        You can combine both syntaxes together.

    question_entities (List of :obj:`~pyrogram.types.MessageEntity`):
        List of special entities that appear in the poll question, which can be specified instead of
        *parse_mode*.

    explanation (``str``, *optional*):
        Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style
        poll, 0-200 characters with at most 2 line feeds after entities parsing.

    explanation_parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
        By default, texts are parsed using both Markdown and HTML styles.
        You can combine both syntaxes together.

    explanation_entities (List of :obj:`~pyrogram.types.MessageEntity`):
        List of special entities that appear in the poll explanation, which can be specified instead of
        *parse_mode*.

    open_period (``int``, *optional*):
        Amount of time in seconds the poll will be active after creation, 5-600.
        Can't be used together with *close_date*.

    close_date (:py:obj:`~datetime.datetime`, *optional*):
        Point in time when the poll will be automatically closed.
        Must be at least 5 and no more than 600 seconds in the future.
        Can't be used together with *open_period*.

    is_closed (``bool``, *optional*):
        Pass True, if the poll needs to be immediately closed.
        This can be useful for poll preview.

    disable_notification (``bool``, *optional*):
        Sends the message silently.
        Users will receive a notification with no sound.

    protect_content (``bool``, *optional*):
        Protects the contents of the sent message from forwarding and saving.

    message_thread_id (``int``, *optional*):
        Unique identifier for the target message thread (topic) of the forum.
        For supergroups only.

    effect_id (``int``, *optional*):
        Unique identifier of the message effect.
        For private chats only.

    reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*):
        Describes reply parameters for the message that is being sent.

    schedule_date (:py:obj:`~datetime.datetime`, *optional*):
        Date when the message will be automatically sent.

    repeat_period (``int``, *optional*):
        Period after which the message will be sent again in seconds.

    business_connection_id (``str``, *optional*):
        Unique identifier of the business connection on behalf of which the message will be sent.

    options_parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
        By default, texts are parsed using both Markdown and HTML styles.
        You can combine both syntaxes together.

    allow_paid_broadcast (``bool``, *optional*):
        If True, you will be allowed to send up to 1000 messages per second.
        Ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message.
        The relevant Stars will be withdrawn from the bot's balance.
        For bots only.

    paid_message_star_count (``int``, *optional*):
        The number of Telegram Stars the user agreed to pay to send the messages.

    reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
        Additional interface options. An object for an inline keyboard, custom reply keyboard,
        instructions to remove reply keyboard or to force a reply from the user.

Returns:
    :obj:`~pyrogram.types.Message`: On success, the sent poll message is returned.

Example:
    .. code-block:: python

        await app.send_poll(chat_id, "Is this a poll question?", ["Yes", "No", "Maybe"])
Nzj`reply_to_message_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zg`reply_to_chat_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.za`quote_text` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zg`quote_parse_mode` is deprecated and will be removed in future updates. Use `reply_parameters` instead.ze`quote_entities` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zc`quote_offset` is deprecated and will be removed in future updates. Use `reply_parameters` instead.)
message_idr   quoter-   r.   quote_position)textentities)r5   optionF)	idr   answersclosedpublic_votersmultiple_choicequizclose_periodr   )pollcorrect_answerssolutionsolution_entities )peermediamessagesilentreply_to	random_idr#   schedule_repeat_period
noforwardsallow_paid_floodskipallow_paid_starsr)   effect)r%   )clientmessagesr   )anylogwarningr	   ReplyParametersr
   parse_text_entitiesvalues	enumerateappendr   
PollAnswerTextWithEntitiesbytesinvoke	functionsrP   	SendMediaresolve_peerInputMediaPollPollrnd_idr   PollTypeQUIZdatetime_to_timestampget_reply_towriteparse_messages)+r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   rA   rB   r9   ioptr7   option_entitiesrrP   s+                                              P/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/messages/send_poll.py	send_pollSendPoll.send_poll   s    @ #4/ ,$& ,d*D(	
 	
 #. A  +} %w  +} ){ 'y  %44.( !1-+  .3-F-F/.
 (
68 	$ .3-F-F5.
 (
68 	$# (FAs-2-F-Fc-t. (vx $FO NN		$$33/J_]_3` !: %  ) ++MM"",,,,W55ii..;;=!$!;!;!)%6%<" "< " !((*6&6(?!U^^%8%88AE%0#(#>#>z#J (  EVDaU,=+>%?$@gk%&7&=2# / & +$11$%  
 ++-#99-H'4*%9!8?K<#5#5d#;;;QU G - $J $:M  '
 '
R --TAFF&x{0D0C(
(
( 6, <G'
R Gs   C&N(N).NN
ANNB7NNC+N NANN"NNN4N5N
NNNNNNN )__name__
__module____qualname____firstlineno__r   rc   REGULARr   intstrr   boolr   r   rn   __static_attributes__rp       rm   r   r      s    "!&!7!726+/;?CG%)>BFJ%))-$(/3*.+/#'>B,0'+04:>%)'+ -16:$(8<@D&*UR1R1sCxR1 R1 c	R1
 R1 R1 "*$R1 $C=R1 &&78R1 $D)>$?@R1 c]R1 !)): ;R1 't,A'BCR1 c]R1 X&R1  D>!R1" 'tn#R1$ "$%R1& $C='R1( C=)R1* ##:;+R1,  )-R1.  }/R10 !)1R12 %%673R14 #5R16 "%7R18 #
9R1J &c]KR1L #5c?3MR1N SMOR1P ##45QR1R !&;!<=SR1T smUR1V 
WR1 R1rz   r   )loggingr   typingr   r   r   pyrogramr   r   r	   r
   	getLoggerrq   rR   r   rp   rz   rm   <module>r      s8   &   ( (  - -!S1 S1rz   