Annotation Interface EditedChannelPostHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(EditedChannelPostHandlers.class) public @interface EditedChannelPostHandler
Annotation for handling edited channel post events in a declarative manner. Designed specifically for handling events when a channel post is edited, providing filtering options for commands, text content, regular expressions, message types, and custom filtering logic. This annotation enables structured handling of post edits in Telegram channels with comprehensive filtering capabilities.

It is the same as using BotClient.onEditedChannelPost(FilterExecutor, UpdateHandler)
Since:
1.2.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the bot commands to match in edited channel posts.
    Class<? extends CustomFilter>
    Custom filter class for advanced filtering of edited channel post events.
    int
    Priority order for handler registration and execution.
    Regular expression pattern to match against edited channel post text content.
    Specifies exact text content to match in the edited channel post.
    Specifies the message types to match in edited channel posts.
  • Element Details

    • commands

      String[] commands
      Specifies the bot commands to match in edited channel posts. Multiple commands are combined using OR logic - the handler will trigger if the edited channel post contains any of the specified commands.
      Returns:
      array of command strings to match
      Default:
      {}
    • texts

      String[] texts
      Specifies exact text content to match in the edited channel post. Multiple texts are combined using OR logic - the handler will trigger if the edited channel post text exactly matches any of the specified strings.
      Returns:
      array of exact text strings to match
      Default:
      {}
    • regex

      String regex
      Regular expression pattern to match against edited channel post text content. The handler will trigger if the edited channel post text matches the specified regex pattern.
      Returns:
      regex pattern string for channel post text matching
      Default:
      ""
    • type

      MessageType[] type
      Specifies the message types to match in edited channel posts. Multiple message types are combined using OR logic - the handler will trigger if the edited channel post type matches any of the specified types.
      Returns:
      array of MessageType enum values to filter by
      Default:
      {}
    • filter

      Class<? extends CustomFilter> filter
      Custom filter class for advanced filtering of edited channel post events. Use this to implement custom logic for determining which channel post edits 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