Annotation Interface ModalHandler


@Retention(RUNTIME) @Target(METHOD) public @interface ModalHandler
Marks a method as a modal submission handler.

Example:

@ModalHandler("feedback")
public void handleFeedback(ModalInteractionEvent event) {
    String feedback = event.getValue("feedback-input").getAsString();
    event.reply("Thanks for your feedback!").setEphemeral(true).queue();
}

The value is the modal ID prefix.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the modal ID prefix used to identify and route modal submissions to this handler