Annotation Interface InlineHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(InlineHandlers.class) public @interface InlineHandler
Annotation for handling inline query events in a declarative manner. Designed for handling events when users perform inline searches across Telegram, providing filtering options for query content, chat types, regular expressions, and custom filtering logic. This annotation enables structured handling of inline queries with comprehensive filtering capabilities for building responsive inline search experiences.

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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the chat types where this inline handler should be active.
    Class<? extends CustomFilter>
    Custom filter class for advanced filtering of inline query events.
    int
    Priority order for handler registration and execution.
    Specifies the query text to match in inline searches.
    Regular expression pattern to match against inline query text.
  • Element Details

    • query

      String[] query
      Specifies the query text to match in inline searches. Multiple query strings are combined using OR logic - the handler will trigger if the inline query matches any of the specified strings.
      Returns:
      array of query strings to match
      Default:
      {}
    • chatType

      ChatType[] chatType
      Specifies the chat types where this inline handler should be active. Multiple chat types are combined using OR logic - the handler will trigger if the chat type matches any of the specified types.
      Returns:
      array of ChatType enum values to filter by
      Default:
      {}
    • regex

      String regex
      Regular expression pattern to match against inline query text. The handler will trigger if the inline query matches the specified regex pattern.
      Returns:
      regex pattern string for query matching
      Default:
      ""
    • filter

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