From 449f318e6d06dd1aeed5cd18d1533b6ef3da1aec Mon Sep 17 00:00:00 2001 From: kalmengr <46006289+kalmengr@users.noreply.github.com> Date: Fri, 12 Jul 2019 18:29:35 -0400 Subject: [PATCH] Add retract_vote bound method to Message --- .../types/messages_and_media/message.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pyrogram/client/types/messages_and_media/message.py b/pyrogram/client/types/messages_and_media/message.py index 144f04a4..80597e33 100644 --- a/pyrogram/client/types/messages_and_media/message.py +++ b/pyrogram/client/types/messages_and_media/message.py @@ -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,