mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-09-28 03:45:55 +00:00
Add bound method Message.react (#937)
* Bound method `react` to send reaction * Update message.py * Update message.py * Update compiler.py Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
This commit is contained in:
parent
e50b58980a
commit
0825b977ea
@ -518,6 +518,7 @@ def pyrogram_api():
|
||||
Message.reply_video_note
|
||||
Message.reply_voice
|
||||
Message.get_media_group
|
||||
Message.react
|
||||
""",
|
||||
chat="""
|
||||
Chat
|
||||
|
@ -3286,6 +3286,42 @@ class Message(Object, Update):
|
||||
else:
|
||||
await self.reply(button, quote=quote)
|
||||
|
||||
async def react(self, emoji: str = "") -> bool:
|
||||
"""Bound method *react* of :obj:`~pyrogram.types.Message`.
|
||||
|
||||
Use as a shortcut for:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
client.send_reaction(
|
||||
chat_id=chat_id,
|
||||
message_id=message.message_id,
|
||||
emoji="🔥"
|
||||
)
|
||||
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
message.react(emoji="🔥")
|
||||
|
||||
Parameters:
|
||||
emoji (``str``, *optional*):
|
||||
Reaction emoji.
|
||||
Pass "" as emoji (default) to retract the reaction.
|
||||
|
||||
Returns:
|
||||
``bool``: On success, True is returned.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
"""
|
||||
|
||||
return await self._client.send_reaction(
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
emoji=emoji
|
||||
)
|
||||
|
||||
async def retract_vote(
|
||||
self,
|
||||
) -> "types.Poll":
|
||||
|
Loading…
Reference in New Issue
Block a user