Skip to content

Commit 719bd87

Browse files
Update send_reaction description
1 parent c991036 commit 719bd87

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

pyrogram/methods/messages/send_reaction.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ async def send_reaction(
3939
chat_id (``int`` | ``str``):
4040
Unique identifier (int) or username (str) of the target chat.
4141
42-
message_id (``int``):
42+
message_id (``int``, *optional*):
4343
Identifier of the message.
4444
45-
story_id (``int``):
45+
story_id (``int``, *optional*):
4646
Identifier of the story.
4747
4848
emoji (``int`` | ``str``, *optional*):
4949
Reaction emoji.
50-
Pass "" as emoji (default) to retract the reaction.
50+
Pass None as emoji (default) to retract the reaction.
5151
5252
big (``bool``, *optional*):
5353
Pass True to show a bigger and longer reaction.
@@ -60,10 +60,16 @@ async def send_reaction(
6060
.. code-block:: python
6161
6262
# Send a reaction
63-
await app.send_reaction(chat_id, message_id, "🔥")
63+
await app.send_reaction(chat_id, message_id=message_id, emoji="🔥")
64+
65+
# Send a reaction with premium emoji
66+
await app.send_reaction(chat_id, message_id=message_id, emoji=5319161050128459957)
67+
68+
# Send a reaction to story
69+
await app.send_reaction(chat_id, story_id=story_id, emoji="❤️")
6470
6571
# Retract a reaction
66-
await app.send_reaction(chat_id, message_id)
72+
await app.send_reaction(chat_id, message_id=message_id)
6773
"""
6874
if isinstance(emoji, int):
6975
emoji = [raw.types.ReactionCustomEmoji(document_id=emoji)]
@@ -74,7 +80,7 @@ async def send_reaction(
7480
rpc = raw.functions.stories.SendReaction(
7581
peer=await self.resolve_peer(chat_id),
7682
story_id=story_id,
77-
reaction=emoji[0],
83+
reaction=emoji[0] if emoji else None,
7884
)
7985
else:
8086
rpc = raw.functions.messages.SendReaction(

0 commit comments

Comments
 (0)