mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-23 23:34:28 +00:00
Update send_reaction description
This commit is contained in:
parent
c991036a85
commit
719bd87038
@ -39,15 +39,15 @@ class SendReaction:
|
|||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
Unique identifier (int) or username (str) of the target chat.
|
Unique identifier (int) or username (str) of the target chat.
|
||||||
|
|
||||||
message_id (``int``):
|
message_id (``int``, *optional*):
|
||||||
Identifier of the message.
|
Identifier of the message.
|
||||||
|
|
||||||
story_id (``int``):
|
story_id (``int``, *optional*):
|
||||||
Identifier of the story.
|
Identifier of the story.
|
||||||
|
|
||||||
emoji (``int`` | ``str``, *optional*):
|
emoji (``int`` | ``str``, *optional*):
|
||||||
Reaction emoji.
|
Reaction emoji.
|
||||||
Pass "" as emoji (default) to retract the reaction.
|
Pass None as emoji (default) to retract the reaction.
|
||||||
|
|
||||||
big (``bool``, *optional*):
|
big (``bool``, *optional*):
|
||||||
Pass True to show a bigger and longer reaction.
|
Pass True to show a bigger and longer reaction.
|
||||||
@ -60,10 +60,16 @@ class SendReaction:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# Send a reaction
|
# Send a reaction
|
||||||
await app.send_reaction(chat_id, message_id, "🔥")
|
await app.send_reaction(chat_id, message_id=message_id, emoji="🔥")
|
||||||
|
|
||||||
|
# Send a reaction with premium emoji
|
||||||
|
await app.send_reaction(chat_id, message_id=message_id, emoji=5319161050128459957)
|
||||||
|
|
||||||
|
# Send a reaction to story
|
||||||
|
await app.send_reaction(chat_id, story_id=story_id, emoji="❤️")
|
||||||
|
|
||||||
# Retract a reaction
|
# Retract a reaction
|
||||||
await app.send_reaction(chat_id, message_id)
|
await app.send_reaction(chat_id, message_id=message_id)
|
||||||
"""
|
"""
|
||||||
if isinstance(emoji, int):
|
if isinstance(emoji, int):
|
||||||
emoji = [raw.types.ReactionCustomEmoji(document_id=emoji)]
|
emoji = [raw.types.ReactionCustomEmoji(document_id=emoji)]
|
||||||
@ -74,7 +80,7 @@ class SendReaction:
|
|||||||
rpc = raw.functions.stories.SendReaction(
|
rpc = raw.functions.stories.SendReaction(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
story_id=story_id,
|
story_id=story_id,
|
||||||
reaction=emoji[0],
|
reaction=emoji[0] if emoji else None,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
rpc = raw.functions.messages.SendReaction(
|
rpc = raw.functions.messages.SendReaction(
|
||||||
|
Loading…
Reference in New Issue
Block a user