Message.react()

Message.react()

Bound method react of Message.

Use as a shortcut for:

await client.set_reaction(
    chat_id=chat_id,
    message_id=message.id,
    reaction=[ReactionTypeEmoji(emoji="👍")]
)

Example

# Send a reaction
await message.react([ReactionTypeEmoji(emoji="👍")])

# Retract a reaction
await message.react()
Parameters:
  • reaction (``int`` | ``str`` | List of ``int`` OR ``str`` | List of :obj:`~pyrogram.types.ReactionType`, *optional*) – New list of reaction types to set on the message. Pass None as emoji (default) to retract the reaction.

  • is_big (``bool``, *optional*) – Pass True to set the reaction with a big animation. Defaults to False.

  • add_to_recent (``bool``, *optional*) – Pass True if the reaction should appear in the recently used reactions. This option is applicable only for users. Defaults to True.

Returns:

On success, :obj:`~pyrogram.types.MessageReactions` (is returned.)

Raises:

RPCError –