
    N[i                     D    d dl mZ d dlZd dlmZ d dlmZ  G d d      Zy)    )UnionN)raw)typesc                   6    e Zd Z	 ddddeeef   dedddd	f
d
Zy)StopPollNselfzpyrogram.Clientchat_id
message_idreply_markupztypes.InlineKeyboardMarkupreturnz
types.Pollc                 N  K   | j                  ||       d{   j                  }| j                  t        j                  j
                  j                  | j                  |       d{   |t        j                  j                  t        j                  j                  t        |j                        ddg             |r|j                  |        d{   nd             d{   }t        j                  j                  | |j                  d         S 7 7 7 I7 8w)a  Stop a poll which was sent by you.

        Stopped polls can't be reopened and nobody will be able to vote in it anymore.

        .. 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).

            message_id (``int``):
                Identifier of the original message with the poll.

            reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
                An InlineKeyboardMarkup object.

        Returns:
            :obj:`~pyrogram.types.Poll`: On success, the stopped poll with the final results is returned.

        Example:
            .. code-block:: python

                await app.stop_poll(chat_id, message_id)
        NT )idclosedquestionanswers)poll)peerr   mediar   r   )get_messagesr   invoker   	functionsmessagesEditMessageresolve_peerr   InputMediaPollPollintr   write_parseupdates)r   r	   r
   r   r   rs         V/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/messages/stop_poll.py	stop_pollzStopPoll.stop_poll   s     @ ''<<BB++MM""..,,W55ii..tww<#!# "	 (  /  @L<#5#5d#;;;QU / 
 
  zz  qyy|44% = 6 <
sG   D%DAD%)D*A-D%D!D%*D#+2D%D%!D%#D%)N)__name__
__module____qualname__r   r   strr$        r#   r   r      sB    
 6:	2525sCx25 25 3	25
 
25r*   r   )typingr   pyrogramr   r   r   r)   r*   r#   <module>r-      s   &    35 35r*   