Annotation 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
-
Element Details
-
value
String valueReturns the base name for slash commands.- Returns:
- the base name for slash commands
- Default:
""
-