Annotation Interface ChosenInlineHandler
@Retention(RUNTIME)
@Target(METHOD)
@Repeatable(ChosenInlineHandlers.class)
public @interface ChosenInlineHandler
Annotation for handling chosen inline result events in a declarative manner.
 Designed specifically for handling events when a user selects a result from
 an inline query, providing feedback about which result was chosen and the original query.
 
Equivalent with using
Basic chosen inline result handler example:
 @ChosenInlineHandler
 void handleChosenResult(BotContext context, ChosenInlineResult result) {
     // Handle when a user selects an inline result
 }
 Specific result ID handler example:
 @ChosenInlineHandler(resultId = "news_article_123")
 void handleNewsArticleSelection(BotContext context, ChosenInlineResult result) {
     // Handle when a specific news article result is chosen
 }
 Query-based handler example:
 @ChosenInlineHandler(query = "weather")
 void handleWeatherQuerySelection(BotContext context, ChosenInlineResult result) {
     // Handle when any result from a "weather" query is chosen
 }
 Equivalent with using
BotClient.onChosenInlineResult(FilterExecutor, UpdateHandler)- Since:
- 1.2.0
- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionClass<? extends CustomFilter> Custom filter class for advanced filtering of chosen inline result events.intPriority order for handler registration and execution.String[]Specifies the original inline query text to match.String[]Specifies the inline result IDs to match.
- 
Element Details- 
resultIdString[] resultIdSpecifies the inline result IDs to match. Multiple result IDs are combined using OR logic - the handler will trigger if the chosen result ID matches any of the specified values. Useful for tracking specific content selections or implementing analytics.- Returns:
- array of result ID strings to match
 - Default:
- {}
 
- 
queryString[] querySpecifies the original inline query text to match. Multiple query strings are combined using OR logic - the handler will trigger if the original query matches any of the specified strings. Useful for categorizing chosen results by search intent.- Returns:
- array of query strings to match
 - Default:
- {}
 
- 
filterClass<? extends CustomFilter> filterCustom filter class for advanced filtering of chosen inline result events. Use this to implement custom logic for determining which chosen results should trigger this handler, such as filtering by user characteristics, location, timing, or other application-specific criteria.- Returns:
- class implementing CustomFilterinterface
 - Default:
- io.github.natanimn.telebof.filters.DefaultCustomFilter.class
 
- 
priorityint priorityPriority order for handler registration and execution. Handlers with lower priority numbers are registered and executed before those with higher numbers. This allows controlling the order of handler processing when multiple handlers could match the same chosen result event.- Returns:
- priority integer value (lower = earlier execution)
 - Default:
- 0
 
 
-