2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Merge pull request #279 from kalmengr/patch-5

Add retract_vote bound method to Message
This commit is contained in:
Dan 2019-07-22 14:22:02 +02:00 committed by GitHub
commit 0b66cf2cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2868,6 +2868,38 @@ class Message(Object, Update):
raise ValueError("This button is not supported yet")
else:
self.reply(button, quote=quote)
def retract_vote(
self,
) -> "Poll":
"""Bound method *retract_vote* of :obj:`Message`.
Use as a shortcut for:
.. code-block:: python
client.retract_vote(
chat_id=message.chat.id,
message_id=message_id,
)
Example:
.. code-block:: python
message.retract_vote()
Returns:
:obj:`Poll`: On success, the poll with the retracted vote is returned.
Raises:
RPCError: In case of a Telegram RPC error.
"""
return self._client.retract_vote(
chat_id=self.chat.id,
message_id=self.message_id
)
def download(
self,