From 098b06d1b742bf8aa874115789e3bd644e91a896 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 24 Dec 2018 14:32:53 +0100 Subject: [PATCH] Fix poll docstrings and vote_poll wrong attribute access --- pyrogram/client/methods/messages/vote_poll.py | 2 +- .../types/messages_and_media/poll_option.py | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pyrogram/client/methods/messages/vote_poll.py b/pyrogram/client/methods/messages/vote_poll.py index 7d2d10cc..3404a7bd 100644 --- a/pyrogram/client/methods/messages/vote_poll.py +++ b/pyrogram/client/methods/messages/vote_poll.py @@ -53,7 +53,7 @@ class VotePoll(BaseClient): functions.messages.SendVote( peer=self.resolve_peer(chat_id), msg_id=message_id, - options=[poll.options[option]._data] + options=[poll.options[option].data] ) ) diff --git a/pyrogram/client/types/messages_and_media/poll_option.py b/pyrogram/client/types/messages_and_media/poll_option.py index 175b3701..240368fc 100644 --- a/pyrogram/client/types/messages_and_media/poll_option.py +++ b/pyrogram/client/types/messages_and_media/poll_option.py @@ -21,24 +21,25 @@ from ..pyrogram_type import PyrogramType class PollOption(PyrogramType): + """This object represents a Poll Option. + + Args: + text (``str``): + Text of the poll option. + + voters (``int``): + The number of users who voted this option. + + data (``bytes``): + Unique data that identifies this option among all the other options in a poll. + """ + def __init__(self, *, client: "pyrogram.client.ext.BaseClient", text: str, voters: int, data: bytes): - """This object represents a Poll Option. - - Args: - text (``str``): - Text of the poll option. - - voters (``int``): - The number of users who voted this option. - - data (``bytes``): - Unique data that identifies this option (among all the other options in a poll). - """ super().__init__(client) self.text = text