Annotation Interface Execute
Identifies the handler method to invoke when an interaction is triggered.
The annotated method can either take zero parameters or accept a single
SlashCommandInteractionEvent argument.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIndicates whether the framework should automatically defer the interaction before executing the method.booleanDefines whether the deferred response should be visible only to the command invoker (ephemeral).The required permissions the invoking member must possess in the guild to run this command.The required permissions the bot itself must possess in the guild to execute this command.
-
Element Details
-
defer
boolean deferIndicates whether the framework should automatically defer the interaction before executing the method. Prevents interaction timeout errors for long-running operations.- Returns:
trueto automatically calldeferReply(), defaults totrue
- Default:
true
-
ephemeral
boolean ephemeralDefines whether the deferred response should be visible only to the command invoker (ephemeral). Ignored ifdefer()is set tofalse.- Returns:
truefor ephemeral deferral, defaults tofalse
- Default:
false
-
permissions
Permission[] permissionsThe required permissions the invoking member must possess in the guild to run this command.- Returns:
- an array of required user permissions, defaults to empty
- Default:
{}
-
selfPermissions
Permission[] selfPermissionsThe required permissions the bot itself must possess in the guild to execute this command.- Returns:
- an array of required bot permissions, defaults to empty
- Default:
{}
-