Annotation Interface ShippingHandler


@Retention(RUNTIME) @Target(METHOD) @Repeatable(ShippingHandlers.class) public @interface ShippingHandler
Annotation for handling shipping query events in a declarative manner. Designed specifically for handling events when users proceed with shipping information during checkout processes, providing validation and calculation capabilities for shipping options and costs. This annotation enables structured handling of shipping queries with filtering options for payload content and custom logic for processing shipping information, calculating costs, and validating delivery addresses.

Equivalent with using BotClient.onShipping(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 shipping query events.
    Specifies the shipping query payload identifiers to match.
    int
    Priority order for handler registration and execution.
  • Element Details

    • payload

      String[] payload
      Specifies the shipping query payload identifiers to match. Multiple payload values are combined using OR logic - the handler will trigger if the shipping query payload matches any of the specified identifiers.
      Returns:
      array of payload identifier strings to match
      Default:
      {}
    • filter

      Class<? extends CustomFilter> filter
      Custom filter class for advanced filtering of shipping query events. Use this to implement custom logic for determining which shipping queries should trigger this handler, such as filtering by destination regions, shipping methods, product types, weight categories, or customer tiers.
      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