Class Command.Option
java.lang.Object
net.dv8tion.jda.api.interactions.commands.Command.Option
- Enclosing interface:
Command
An Option for a command.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@Unmodifiable Set
<ChannelType> TheChannelTypes
this option is restricted to.@Unmodifiable List
<Command.Choice> The predefined choices available for this option.The description of this option, subcommand, or subcommand group.The localizations of this option's description forvarious languages
.The maximum length for strings which can be provided for this option.The maximum value which can be provided for this option.The minimum length for strings which can be provided for this option.The minimum value which can be provided for this option.getName()
The name of this option, subcommand, or subcommand group.The localizations of this option's name forvarious languages
.getType()
TheOptionType
.int
The raw option type.int
hashCode()
boolean
Whether this option supports auto-completeboolean
Whether this option is requiredtoString()
-
Constructor Details
-
Option
-
-
Method Details
-
getName
The name of this option, subcommand, or subcommand group.- Returns:
- The name
-
getNameLocalizations
The localizations of this option's name forvarious languages
.- Returns:
- The
LocalizationMap
containing the mapping fromDiscordLocale
to the localized name
-
getDescription
The description of this option, subcommand, or subcommand group.- Returns:
- The description
-
getDescriptionLocalizations
The localizations of this option's description forvarious languages
.- Returns:
- The
LocalizationMap
containing the mapping fromDiscordLocale
to the localized description
-
getTypeRaw
public int getTypeRaw()The raw option type.- Returns:
- The type
-
isRequired
public boolean isRequired()Whether this option is required- Returns:
- True if this option is required
-
isAutoComplete
public boolean isAutoComplete()Whether this option supports auto-complete- Returns:
- True if this option supports auto-complete
-
getType
TheOptionType
.- Returns:
- The type
-
getChannelTypes
TheChannelTypes
this option is restricted to.
This is empty if the option is not of typeCHANNEL
or not restricted to specific types.- Returns:
- Immutable
Set
ofChannelType
-
getMinValue
The minimum value which can be provided for this option.
This returnsnull
if the value is not set or if the option is not of typeINTEGER
orNUMBER
.- Returns:
- The minimum value for this option or
null
-
getMaxValue
The maximum value which can be provided for this option.
This returnsnull
if the value is not set or if the option is not of typeINTEGER
orNUMBER
.- Returns:
- The maximum value for this option or
null
-
getMinLength
The minimum length for strings which can be provided for this option.
This returnsnull
if the value is not set or if the option is not of typeSTRING
.- Returns:
- The minimum length for strings for this option or
null
-
getMaxLength
The maximum length for strings which can be provided for this option.
This returnsnull
if the value is not set or if the option is not of typeSTRING
.- Returns:
- The maximum length for strings for this option or
null
-
getChoices
The predefined choices available for this option.
If no choices are defined, this returns an empty list.- Returns:
- Immutable
List
ofCommand.Choice
-
hashCode
public int hashCode() -
equals
-
toString
-