setMessageReaction#

Returns: bool

class aiogram.methods.set_message_reaction.SetMessageReaction(*, chat_id: int | str, message_id: int, reaction: List[ReactionTypeEmoji | ReactionTypeCustomEmoji] | None = None, is_big: bool | None = None, **extra_data: Any)[source]#

Use this method to change the chosen reactions on a message. Service messages can’t be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Returns True on success.

Source: https://core.telegram.org/bots/api#setmessagereaction

chat_id: int | str#

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

message_id: int#

Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

reaction: List[ReactionTypeEmoji | ReactionTypeCustomEmoji] | None#

New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.

is_big: bool | None#

Pass True to set the reaction with a big animation

Usage#

As bot method#

result: bool = await bot.set_message_reaction(...)

Method as object#

Imports:

  • from aiogram.methods.set_message_reaction import SetMessageReaction

  • alias: from aiogram.methods import SetMessageReaction

With specific bot#

result: bool = await bot(SetMessageReaction(...))

As reply into Webhook in handler#

return SetMessageReaction(...)

As shortcut from received object#