Annotation Interface Interaction


@Target(TYPE) @Retention(RUNTIME) public @interface Interaction

Classes annotated with Interaction are responsible for defining and handling interactions.

A class annotated with Interaction can define interactions via its methods. Therefore, such methods must be annotated with one of the following interaction annotations: SlashCommand, ContextCommand, Button, EntitySelectMenu, StringSelectMenu or Modal. See the respective annotations for details.

Example:

@Interaction
public class InteractionClass {

    @SlashCommand("greet")
    public void onCommand(CommandEvent event) {
        event.reply("Hello World!");
    }
}
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the base name for slash commands.
  • Element Details

    • value

      String value
      Returns the base name for slash commands.
      Returns:
      the base name for slash commands
      Default:
      ""