Visitar URL original
Merge branch 'develop' of https://github.com/pyrogram/pyrogram into d… · hexa0code/pyrogram@881f5ab · GitHub
Skip to content

Commit 881f5ab

Browse files
committed
Merge branch 'develop' of https://github.com/pyrogram/pyrogram into develop
2 parents 2dec244 + 0b66cf2 commit 881f5ab

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

  • pyrogram/client/types/messages_and_media

‎pyrogram/client/types/messages_and_media/message.py‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,6 +2857,38 @@ def click(self, x: int or str, y: int = 0, quote: bool = None, timeout: int = 10
28572857
raise ValueError("This button is not supported yet")
28582858
else:
28592859
self.reply(button, quote=quote)
2860+
2861+
2862+
def retract_vote(
2863+
self,
2864+
) -> "Poll":
2865+
"""Bound method *retract_vote* of :obj:`Message`.
2866+
2867+
Use as a shortcut for:
2868+
2869+
.. code-block:: python
2870+
2871+
client.retract_vote(
2872+
chat_id=message.chat.id,
2873+
message_id=message_id,
2874+
)
2875+
2876+
Example:
2877+
.. code-block:: python
2878+
2879+
message.retract_vote()
2880+
2881+
Returns:
2882+
:obj:`Poll`: On success, the poll with the retracted vote is returned.
2883+
2884+
Raises:
2885+
RPCError: In case of a Telegram RPC error.
2886+
"""
2887+
2888+
return self._client.retract_vote(
2889+
chat_id=self.chat.id,
2890+
message_id=self.message_id
2891+
)
28602892

28612893
def download(
28622894
self,
@@ -2925,6 +2957,43 @@ def download(
29252957
progress=progress,
29262958
progress_args=progress_args,
29272959
)
2960+
def vote(
2961+
self,
2962+
option: int,
2963+
) -> "Poll":
2964+
"""Bound method *vote* of :obj:`Message`.
2965+
2966+
Use as a shortcut for:
2967+
2968+
.. code-block:: python
2969+
2970+
client.vote_poll(
2971+
chat_id=message.chat.id,
2972+
message_id=message.message_id,
2973+
option=1
2974+
)
2975+
2976+
Example:
2977+
.. code-block:: python
2978+
2979+
message.vote(6)
2980+
2981+
Parameters:
2982+
option (``int``):
2983+
Index of the poll option you want to vote for (0 to 9).
2984+
2985+
Returns:
2986+
:obj:`Poll`: On success, the poll with the chosen option is returned.
2987+
2988+
Raises:
2989+
RPCError: In case of a Telegram RPC error.
2990+
"""
2991+
2992+
return self._client.vote_poll(
2993+
chat_id=self.chat.id,
2994+
message_id=self.message_id,
2995+
option=option
2996+
)
29282997

29292998
def pin(self, disable_notification: bool = None) -> "Message":
29302999
"""Bound method *pin* of :obj:`Message`.

0 commit comments

Comments
 (0)