Available methods

setMessageReaction()

Use this method to change the chosen reactions on a message. Service messages of some types 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. Bots can't use paid reactions. Returns True on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
message_idnumberrequiredIdentifier 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.
reactionReactionType[]optionalA JSON-serialized 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. Paid reactions can't be used by bots.
is_bigbooleanoptionalPass True to set the reaction with a big animation

returns

boolean

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { SetMessageReactionParams } from "@yaebal/types";

await bot.api.call<boolean>("setMessageReaction", {
  chat_id: 123456789,
  message_id: 1,
} satisfies SetMessageReactionParams);

context shortcut

also available as ctx.react() on 10 context types — see @yaebal/contexts.

context shortcut
/** Use this method to change the chosen reactions on a message. Service messages of some types 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. Bots can't use paid reactions. Returns *True* on success. */
ctx.react(params: Omit<SetMessageReactionParams, "chat_id" | "message_id">)