Class Command.Option
- java.lang.Object
-
- net.dv8tion.jda.api.interactions.commands.Command.Option
-
-
Constructor Summary
Constructors Constructor Description Option(DataObject json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Set<ChannelType>getChannelTypes()TheChannelTypesthis option is restricted to.List<Command.Choice>getChoices()The predefined choices available for this option.StringgetDescription()The description of this option, subcommand, or subcommand group.NumbergetMaxValue()The maximum value which can be provided for this option.NumbergetMinValue()The minimum value which can be provided for this option.StringgetName()The name of this option, subcommand, or subcommand group.OptionTypegetType()TheOptionType.intgetTypeRaw()The raw option type.inthashCode()booleanisRequired()Whether this option is requiredStringtoString()
-
-
-
Constructor Detail
-
Option
public Option(@Nonnull DataObject json)
-
-
Method Detail
-
getName
@Nonnull public String getName()
The name of this option, subcommand, or subcommand group.- Returns:
- The name
-
getDescription
@Nonnull public String getDescription()
The description of this option, subcommand, or subcommand group.- Returns:
- The 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
-
getType
@Nonnull public OptionType getType()
TheOptionType.- Returns:
- The type
-
getChannelTypes
@Nonnull public Set<ChannelType> 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
@Nullable public Number 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
@Nullable public Number 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
-
getChoices
@Nonnull public List<Command.Choice> getChoices()
The predefined choices available for this option.
If no choices are defined, this returns an empty list.- Returns:
- Immutable
ListofCommand.Choice
-
-