Skip to main content
Module

x/grammy_chat_members/deps.deno.ts>Composer#reaction

Store chats, users, and chat memberships.
Latest
method Composer.prototype.reaction
import { Composer } from "https://deno.land/x/grammy_chat_members@v1.1.0/deps.deno.ts";

Registers some middleware that will only be added when a new reaction of the given type is added to a message.

// Reacts to new 'πŸ‘' reactions
bot.reaction('πŸ‘', ctx => { ... })
// Reacts to new 'πŸ‘' or 'πŸ‘Ž' reactions
bot.reaction(['πŸ‘', 'πŸ‘Ž'], ctx => { ... })

Note that you have to enable message_reaction updates in allowed_updates if you want your bot to receive updates about message reactions.

bot.reaction will trigger if:

  • a new emoji reaction is added to a message
  • a new custom emoji reaction is added a message

bot.reaction will not trigger if:

  • a reaction is removed
  • an anonymous reaction count is updated, such as on channel posts
  • message_reaction updates are not enabled for your bot

Parameters

reaction: MaybeArray<ReactionTypeEmoji["emoji"] | ReactionType>

The reaction to look for

...middleware: Array<ReactionMiddleware<C>>

The middleware to register

Returns

Composer<ReactionContext<C>>