Skip to content

Commit

Permalink
Bound method to stop_poll
Browse files Browse the repository at this point in the history
  • Loading branch information
New-dev0 committed Jul 7, 2021
1 parent 8845b97 commit 122534d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -3225,6 +3225,43 @@ async def click(self, x: Union[int, str] = 0, y: int = None, quote: bool = None,
else:
await self.reply(button, quote=quote)

async def stop_poll(
self,
reply_markup: "types.InlineKeyboardMarkup" = None
) -> "types.Poll":
"""Bound method *stop_poll* of :obj:`~pyrogram.types.Message`.
Use as a shortcut for:
.. code-block:: python
client.stop_poll(
chat_id=message.chat.id,
message_id=message_id,
)
Parameters:
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
An InlineKeyboardMarkup object.
Example:
.. code-block:: python
message.stop_poll()
Returns:
:obj:`~pyrogram.types.Poll`: On success, the stopped poll with the final results is returned.
Raises:
RPCError: In case of a Telegram RPC error.
"""

return await self._client.stop_poll(
chat_id=self.chat.id,
message_id=self.message_id,
reply_markup=reply_markup
)

async def retract_vote(
self,
) -> "types.Poll":
Expand Down

0 comments on commit 122534d

Please sign in to comment.