Skip to content

Commit 0b66cf2

Browse files
authored
Merge pull request pyrogram#279 from kalmengr/patch-5
Add retract_vote bound method to Message
2 parents 810df3f + a320088 commit 0b66cf2

File tree

1 file changed

+32
-0
lines changed
  • pyrogram/client/types/messages_and_media

1 file changed

+32
-0
lines changed

pyrogram/client/types/messages_and_media/message.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,6 +2868,38 @@ def click(self, x: int or str, y: int = 0, quote: bool = None, timeout: int = 10
28682868
raise ValueError("This button is not supported yet")
28692869
else:
28702870
self.reply(button, quote=quote)
2871+
2872+
2873+
def retract_vote(
2874+
self,
2875+
) -> "Poll":
2876+
"""Bound method *retract_vote* of :obj:`Message`.
2877+
2878+
Use as a shortcut for:
2879+
2880+
.. code-block:: python
2881+
2882+
client.retract_vote(
2883+
chat_id=message.chat.id,
2884+
message_id=message_id,
2885+
)
2886+
2887+
Example:
2888+
.. code-block:: python
2889+
2890+
message.retract_vote()
2891+
2892+
Returns:
2893+
:obj:`Poll`: On success, the poll with the retracted vote is returned.
2894+
2895+
Raises:
2896+
RPCError: In case of a Telegram RPC error.
2897+
"""
2898+
2899+
return self._client.retract_vote(
2900+
chat_id=self.chat.id,
2901+
message_id=self.message_id
2902+
)
28712903

28722904
def download(
28732905
self,

0 commit comments

Comments
 (0)