Annotation Interface PollAnswerHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(PollAnswerHandlers.class) public @interface PollAnswerHandler
Annotation for handling poll answer events in a declarative manner. Designed specifically for handling events when users answer polls in chats, providing real-time feedback on poll responses and user voting patterns. This annotation enables structured handling of poll interactions with custom filtering capabilities for processing user responses to polls.

Equivalent with using BotClient.onPollAnswer(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 poll answer events.
    int
    Priority order for handler registration and execution.
  • Element Details

    • filter

      Class<? extends CustomFilter> filter
      Custom filter class for advanced filtering of poll answer events. Use this to implement custom logic for determining which poll answers should trigger this handler, such as filtering by specific poll IDs, user characteristics, selected options, or voting patterns.
      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