Annotation Interface ReactionHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(ReactionHandlers.class) public @interface ReactionHandler
Annotation for handling message reaction events in a declarative manner. Designed specifically for handling events when users add or remove reactions to messages, providing real-time monitoring of user interactions and sentiment expression. This annotation enables structured handling of reaction events with filtering options for specific reaction types and custom logic for processing user engagement and interaction patterns.

Equivalent with using BotClient.onReaction(FilterExecutor, UpdateHandler)
Since:
1.2.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends CustomFilter>
    Custom filter class for advanced filtering of reaction events.
    int
    Priority order for handler registration and execution.
    Specifies the specific reaction emoji to match.
  • Element Details

    • reaction

      String reaction
      Specifies the specific reaction emoji to match. The handler will trigger if the reaction added or removed matches the specified emoji string.
      Returns:
      reaction emoji string to match
      Default:
      ""
    • filter

      Class<? extends CustomFilter> filter
      Custom filter class for advanced filtering of reaction events. Use this to implement custom logic for determining which reaction events should trigger this handler, such as filtering by user identity, message content, reaction count, timing patterns, or other engagement metrics.
      Returns:
      class implementing CustomFilter interface
      Default:
      io.github.natanimn.telebof.filters.DefaultCustomFilter.class
    • priority

      int priority
      Priority order for handler registration and execution. Handlers with lower priority numbers are registered and executed before those with higher numbers.
      Returns:
      priority integer value (lower = earlier execution)
      Default:
      0