Enum OptionType
- All Implemented Interfaces:
Serializable
,Comparable<OptionType>
The available types for
Command
options.-
Enum Constant Summary
Enum ConstantDescriptionOptions which accept a file attachmentOptions which accept boolean true or false inputsOptions which accept a singleGuildChannel
Options which acceptLong
integer inputsOptions which accept a singleRole
Options which accept text inputs.Option which is serialized as subcommand, this is only used for internals and should be ignored by users.Option which is serialized as subcommand groups, this is only used for internals and should be ignored by users.Placeholder for future option types -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether options of this type support predefined choices.static OptionType
fromKey
(int key) Converts the provided raw type to the enum constant.int
getKey()
The raw value for this type or -1 forUNKNOWN
static OptionType
Returns the enum constant of this type with the specified name.static OptionType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Placeholder for future option types -
SUB_COMMAND
Option which is serialized as subcommand, this is only used for internals and should be ignored by users.- See Also:
-
SUB_COMMAND_GROUP
Option which is serialized as subcommand groups, this is only used for internals and should be ignored by users.- See Also:
-
STRING
Options which accept text inputs. This also supports role/channel/user mentions.- See Also:
-
INTEGER
Options which acceptLong
integer inputs- See Also:
-
BOOLEAN
Options which accept boolean true or false inputs- See Also:
-
USER
- See Also:
-
CHANNEL
Options which accept a singleGuildChannel
- See Also:
-
ROLE
Options which accept a singleRole
- See Also:
-
MENTIONABLE
- See Also:
-
NUMBER
- See Also:
-
ATTACHMENT
Options which accept a file attachment- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getKey
public int getKey()The raw value for this type or -1 forUNKNOWN
- Returns:
- The raw value
-
canSupportChoices
public boolean canSupportChoices()Whether options of this type support predefined choices.- Returns:
- True, if you can use choices for this type.
-
fromKey
Converts the provided raw type to the enum constant.- Parameters:
key
- The raw type- Returns:
- The OptionType constant or
UNKNOWN
-