2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 21:38:04 +00:00

Fix poll docstrings and vote_poll wrong attribute access

This commit is contained in:
Dan 2018-12-24 14:32:53 +01:00
parent 46d206610e
commit 098b06d1b7
2 changed files with 14 additions and 13 deletions

View File

@ -53,7 +53,7 @@ class VotePoll(BaseClient):
functions.messages.SendVote( functions.messages.SendVote(
peer=self.resolve_peer(chat_id), peer=self.resolve_peer(chat_id),
msg_id=message_id, msg_id=message_id,
options=[poll.options[option]._data] options=[poll.options[option].data]
) )
) )

View File

@ -21,24 +21,25 @@ from ..pyrogram_type import PyrogramType
class PollOption(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, def __init__(self,
*, *,
client: "pyrogram.client.ext.BaseClient", client: "pyrogram.client.ext.BaseClient",
text: str, text: str,
voters: int, voters: int,
data: bytes): 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) super().__init__(client)
self.text = text self.text = text