Skip to content

Commit f477171

Browse files
committed
Document vote_poll
1 parent 03aa509 commit f477171

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

pyrogram/client/methods/messages/vote_poll.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,30 @@
2323

2424

2525
class VotePoll(BaseClient):
26-
# TODO: Docs
2726
def vote_poll(self,
2827
chat_id: Union[int, str],
2928
message_id: id,
3029
option: int) -> bool:
30+
"""Use this method to vote a poll.
31+
32+
Args:
33+
chat_id (``int`` | ``str``):
34+
Unique identifier (int) or username (str) of the target chat.
35+
For your personal cloud (Saved Messages) you can simply use "me" or "self".
36+
For a contact that exists in your Telegram address book you can use his phone number (str).
37+
38+
message_id (``int``):
39+
Unique poll message identifier inside this chat.
40+
41+
option (``int``):
42+
Index of the poll option you want to vote for (0 to 9).
43+
44+
Returns:
45+
On success, True is returned.
46+
47+
Raises:
48+
:class:`Error <pyrogram.Error>` in case of a Telegram RPC error.
49+
"""
3150
poll = self.get_messages(chat_id, message_id).poll
3251

3352
self.send(

0 commit comments

Comments
 (0)