Annotation Interface BotReplyButton


@Target(METHOD) @Retention(RUNTIME) @Documented public @interface BotReplyButton
Maps a @BotController method to one or more ReplyKeyboardMarkup button presses.

When a user presses a reply keyboard button the Telegram API delivers a plain text message whose content equals the button label. The framework matches that text against the declared value() strings using the registered BotReplyButtonMatcher strategy.

Default behaviour (without core-i18n)

Values are compared directly against the incoming message text (exact match):

@BotReplyButton({"Yes", "Да", "Ha"})
public String onYes(BotRequest request) {
    return "Confirmed!";
}

With core-i18n on the classpath

Values are treated as message-bundle keys. The framework resolves each key in the user's locale and compares the result against the incoming text — so a single annotation covers all supported languages automatically:

@BotReplyButton("btn.yes")
public String onYes(BotRequest request) {
    return messages.getMessage("response.confirmed", request);
}
Since:
0.0.1
Author:
Islom Mirsaburov
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    One or more values to match against the incoming text message.
  • Element Details

    • value

      String[] value
      One or more values to match against the incoming text message.

      Without core-i18n: treated as exact text strings.
      With core-i18n: treated as message-bundle keys resolved per user locale.

      Returns:
      array of text values or message keys