diff --git a/pyrogram/client/methods/messages/vote_poll.py b/pyrogram/client/methods/messages/vote_poll.py index 3e91bd4c..c67fc8a2 100644 --- a/pyrogram/client/methods/messages/vote_poll.py +++ b/pyrogram/client/methods/messages/vote_poll.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from typing import Union +from typing import Union, List import pyrogram from pyrogram.api import functions @@ -28,7 +28,7 @@ class VotePoll(BaseClient): self, chat_id: Union[int, str], message_id: id, - option: int + options: Union[int, List[int]] ) -> "pyrogram.Poll": """Vote a poll. @@ -41,8 +41,8 @@ class VotePoll(BaseClient): message_id (``int``): Identifier of the original message with the poll. - option (``int``): - Index of the poll option you want to vote for (0 to 9). + 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:`Poll` - On success, the poll with the chosen option is returned. @@ -54,12 +54,13 @@ class VotePoll(BaseClient): """ poll = self.get_messages(chat_id, message_id).poll + options = [options] if not isinstance(options, list) else options r = self.send( functions.messages.SendVote( peer=self.resolve_peer(chat_id), msg_id=message_id, - options=[poll.options[option]._data] + options=[poll.options[option].data for option in options] ) )