Annotation Interface Modal


@Target(METHOD) @Retention(RUNTIME) public @interface Modal

Methods annotated with Modal will be registered as a modal at startup.

Therefore, the method must be declared inside a class that is annotated with Interaction. Text inputs are defined via method parameters that must be annotated with TextInput.

You can reply with a modal by calling ModalReplyableEvent.replyModal(String).

Example:

@Modal("My Modal")
public void onModal(ModalEvent event, @TextInput("Type here") String input) { ... }
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Gets the title of this modal.
  • Element Details

    • value

      String value
      Gets the title of this modal.
      Returns:
      the title of the modal