Class Command.Option
java.lang.Object
net.dv8tion.jda.api.interactions.commands.Command.Option
- Enclosing interface:
- Command
An Option for a command.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@Unmodifiable Set<ChannelType>TheChannelTypesthis 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.intThe raw option type.inthashCode()booleanWhether this option supports auto-completebooleanWhether 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
LocalizationMapcontaining the mapping fromDiscordLocaleto 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
LocalizationMapcontaining the mapping fromDiscordLocaleto 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
TheChannelTypesthis option is restricted to.
This is empty if the option is not of typeCHANNELor not restricted to specific types.- Returns:
- Immutable
SetofChannelType
-
getMinValue
The minimum value which can be provided for this option.
This returnsnullif the value is not set or if the option is not of typeINTEGERorNUMBER.- Returns:
- The minimum value for this option or
null
-
getMaxValue
The maximum value which can be provided for this option.
This returnsnullif the value is not set or if the option is not of typeINTEGERorNUMBER.- Returns:
- The maximum value for this option or
null
-
getMinLength
The minimum length for strings which can be provided for this option.
This returnsnullif 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 returnsnullif 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
ListofCommand.Choice
-
hashCode
public int hashCode() -
equals
-
toString
-