U
    ;g	                     @   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                   @   s6   e Zd Zdeeef eeeee f ddddZdS )VotePollzpyrogram.Clientz
types.Poll)selfchat_id
message_idoptionsreturnc                    sv   |  ||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 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).

            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   c/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/messages/vote_poll.py
<listcomp>A   s     z&VotePoll.vote_poll.<locals>.<listcomp>)ZpeerZmsg_idr
   r   )Zget_messagesr   
isinstancelistZinvoker   Z	functionsmessagesZSendVoteZresolve_peerr   ZPoll_parseZupdates)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   Zpyrogramr   r   r   r   r   r   r   <module>   s   