telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Class MessageReactionHandler<C, R>

    Handler for user message reaction changes (message_reaction updates).

    const handler = new MessageReactionHandler(async (update, context) => {
    console.log("Reaction changed on message:", update.message_reaction?.message_id);
    });

    Type Parameters

    Hierarchy (View Summary)

    Index
    • Constructs a new MessageReactionHandler.

      Type Parameters

      • C extends CallbackContext<
            Record<string, unknown>,
            Record<string, unknown>,
            Record<string, unknown>,
        > = CallbackContext<
            Record<string, unknown>,
            Record<string, unknown>,
            Record<string, unknown>,
        >

        Type of the callback context.

      • R = unknown

        Return value type.

      Parameters

      • callback: HandlerCallback<C, R>

        Function invoked when the reaction matches.

      • Optionalfilter: ReactionFilter

        Optional filter matching specific emojis, custom emoji IDs, or predicate.

      Returns MessageReactionHandler<C, R>

    callback: HandlerCallback<C, R>

    The underlying callback function to invoke on match.

    • Checks whether the incoming update contains a message_reaction and satisfies the filter.

      Parameters

      • update: Update

        The update to test.

      Returns Promise<boolean>

      true if update matches.

    • Executes the registered handler callback with the given update and context.

      Parameters

      • update: Update

        The Telegram update to process.

      • context: C

        Callback context instance.

      Returns Promise<R>

      The value returned by the callback function.