o
    -˜Žjj  ã                   @   s>   d dl mZ d dlZd dlmZ d dlmZ G dd„ dƒZdS )é    )ÚUnionN)Úraw)Útypesc                   @   s<   e Zd Z		ddddeeef deddded	d
fdd„ZdS )ÚStopPollNÚselfzpyrogram.ClientÚchat_idÚ
message_idÚreply_markupztypes.InlineKeyboardMarkupÚbusiness_connection_idÚreturnz
types.Pollc                 Ã   sÌ   �|   ||¡I dH j}tjjj|  |¡I dH |tjjtjj	t
|jƒdtjjdg d�g d�d�|r8| | ¡I dH ndd�}|durO|  tjj||d�¡I dH }n|  |¡I dH }tj	 | |jd	 |j¡I dH S )
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).
                You can also use chat public link in form of *t.me/<username>* (str).

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

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

            business_connection_id (``str``, *optional*):
                Unique identifier of the business connection.

        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Ú )ÚtextÚentities)ÚidÚclosedÚquestionÚanswers)Úpoll)Úpeerr   Úmediar	   )Úconnection_idÚqueryr   )Úget_messagesr   r   Ú	functionsÚmessagesÚEditMessageÚresolve_peerr   ÚInputMediaPollÚPollÚintr   ÚTextWithEntitiesÚwriteÚinvokeÚInvokeWithBusinessConnectionÚ_parseÚupdatesÚusers)r   r   r   r	   r
   r   ÚrpcÚr© r)   ú`/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/messages/stop_poll.pyÚ	stop_poll   s0   €%üÿõþÿzStopPoll.stop_poll)NN)Ú__name__Ú
__module__Ú__qualname__r   r   Ústrr+   r)   r)   r)   r*   r      s     ûÿ
þýüûúr   )Útypingr   Úpyrogramr   r   r   r)   r)   r)   r*   Ú<module>   s
   