Annotation Interface CommandOption
@ReleasedSince("26.8.301")
@Target({FIELD,TYPE})
@Retention(RUNTIME)
public @interface CommandOption
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe unique identifier/name for this option displayed in the Discord client.The expected Discord data type for this option. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionA helpful description of the argument shown to users.booleanSpecifies whether the user is required to supply this option when executing the command.
-
Element Details
-
type
OptionType typeThe expected Discord data type for this option.- Returns:
- the option type
-
name
String nameThe unique identifier/name for this option displayed in the Discord client.- Returns:
- the option name
-
description
String descriptionA helpful description of the argument shown to users. Defaults to empty string (which falls back to the option name).- Returns:
- the option description
- Default:
""
-
required
boolean requiredSpecifies whether the user is required to supply this option when executing the command.- Returns:
trueif mandatory,falseif optional (defaults tofalse)
- Default:
false
-