Annotation Interface ButtonHandler


@Retention(RUNTIME) @Target(METHOD) public @interface ButtonHandler
Marks a method as a button interaction handler.

Example:

@ButtonHandler("confirm")
public void handleConfirm(ButtonInteractionEvent event) {
    event.reply("Confirmed!").setEphemeral(true).queue();
}

The value is the button ID prefix. If your button ID is "myplugin:confirm:123", use prefix "myplugin:confirm" to match.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      original prefix before sanitize by Core infrastructure