mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 12:57:52 +00:00
Add bound method vote to Message
This commit is contained in:
parent
5599182fd1
commit
2095f9fb5e
@ -2923,6 +2923,43 @@ class Message(Object, Update):
|
|||||||
progress=progress,
|
progress=progress,
|
||||||
progress_args=progress_args,
|
progress_args=progress_args,
|
||||||
)
|
)
|
||||||
|
def vote(
|
||||||
|
self,
|
||||||
|
option: int,
|
||||||
|
) -> "Poll":
|
||||||
|
"""Bound method *vote* of :obj:`Message`.
|
||||||
|
|
||||||
|
Use as a shortcut for:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
client.vote_poll(
|
||||||
|
chat_id=message.chat.id,
|
||||||
|
message_id=message.message_id,
|
||||||
|
option=1
|
||||||
|
)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
message.vote(6)
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
option (``int``):
|
||||||
|
Index of the poll option you want to vote for (0 to 9).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
On success, the poll with the chosen option is returned.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
RPCError: In case of a Telegram RPC error.
|
||||||
|
"""
|
||||||
|
|
||||||
|
return self._client.vote_poll(
|
||||||
|
chat_id=self.chat.id,
|
||||||
|
message_id= self.message_id,
|
||||||
|
option=option
|
||||||
|
)
|
||||||
|
|
||||||
def pin(self, disable_notification: bool = None) -> "Message":
|
def pin(self, disable_notification: bool = None) -> "Message":
|
||||||
"""Bound method *pin* of :obj:`Message`.
|
"""Bound method *pin* of :obj:`Message`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user