Annotation Interface PollHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(PollHandlers.class) public @interface PollHandler
Annotation for handling poll state update events in a declarative manner. Designed specifically for handling events when polls are created, updated, or reach their conclusion in chats, providing real-time monitoring of poll status changes and final results. This annotation enables structured handling of poll lifecycle events with custom filtering capabilities for processing poll state changes and results.

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

    • filter

      Class<? extends CustomFilter> filter
      Custom filter class for advanced filtering of poll state update events. Use this to implement custom logic for determining which poll updates should trigger this handler, such as filtering by specific poll types, question content, option counts, completion status, or result thresholds.
      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