Annotation Interface MyChatMemberHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(MyChatMemberHandlers.class) public @interface MyChatMemberHandler
Annotation for handling the bot's own chat member status updates in a declarative manner. Designed specifically for handling events when the bot's own status changes in a chat, such as when the bot is added to a group, promoted to administrator, restricted, or removed. This annotation enables structured handling of the bot's membership changes with status-based filtering and custom filtering capabilities. Equivalent with using BotClient.onMyChatMember(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 the bot's chat member update events.
    int
    Priority order for handler registration and execution.
    Specifies the chat member status changes to match for the bot.
  • Element Details

    • status

      Specifies the chat member status changes to match for the bot. Multiple status values are combined using OR logic - the handler will trigger if the bot's new status matches any of the specified status values.
      Returns:
      array of ChatMemberStatus enum values to filter by
      Default:
      {}
    • filter

      Class<? extends CustomFilter> filter
      Custom filter class for advanced filtering of the bot's chat member update events. Use this to implement custom logic for determining which of the bot's status changes should trigger this handler.
      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