o
    -˜Žjx
  ã                   @   sB   d dl mZmZ d dlZd dlmZ d dlmZ G dd„ dƒZdS )é    )ÚUnionÚListN)Úraw)Útypesc                   @   s>   e Zd Zdddeeef dedeeee f ddf
dd	„Zd
S )ÚVotePollÚselfzpyrogram.ClientÚchat_idÚ
message_idÚoptionsÚreturnz
types.Pollc                 ƒ   s‚   �|   ||¡I dH j‰ t|tƒs|gn|}|  tjjj|  	|¡I dH |‡ fdd„|D ƒd�¡I dH }t
j | |jd |j¡I dH S )aç  Vote a poll.

        .. include:: /_includes/usable-by/users.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.

            options (``Int`` | List of ``int``):
                Index or list of indexes (for multiple answers) of the poll option(s) you want to vote for (0 to 9).

        Returns:
            :obj:`~pyrogram.types.Poll` - On success, the poll with the chosen option is returned.

        Example:
            .. code-block:: python

                await app.vote_poll(chat_id, message_id, 6)
        Nc                    s   g | ]}ˆ j | j‘qS © )r
   Údata)Ú.0Úoption©Úpollr   ú`/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/messages/vote_poll.pyÚ
<listcomp>C   s    z&VotePoll.vote_poll.<locals>.<listcomp>)ÚpeerÚmsg_idr
   r   )Úget_messagesr   Ú
isinstanceÚlistÚinvoker   Ú	functionsÚmessagesÚSendVoteÚresolve_peerr   ÚPollÚ_parseÚupdatesÚusers)r   r   r	   r
   Úrr   r   r   Ú	vote_poll   s   € ý
ÿzVotePoll.vote_pollN)	Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrÚidr   r#   r   r   r   r   r      s    ÿ
þýüûr   )Útypingr   r   Úpyrogramr   r   r   r   r   r   r   Ú<module>   s
   