Interface SlashCommandInteractionOption
-
- All Superinterfaces:
SlashCommandInteractionOptionsProvider
public interface SlashCommandInteractionOption extends SlashCommandInteractionOptionsProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<Boolean>getBooleanValue()Gets the boolean value of this option.Optional<ServerChannel>getChannelValue()Gets the channel value of this option.Optional<Integer>getIntValue()Gets the integer value of this option.Optional<Mentionable>getMentionableValue()Gets the mentionable value of this option.StringgetName()Gets the name of the option.List<SlashCommandInteractionOption>getOptions()Gets a list with all options of this option, if this option denotes a subcommand or group.Optional<Role>getRoleValue()Gets the role value of this option.Optional<String>getStringValue()Gets the string representation of this option value.Optional<User>getUserValue()Gets the user value of this option.default booleanisSubcommandOrGroup()Checks if the option is a subcommand or group.Optional<CompletableFuture<Mentionable>>requestMentionableValue()Gets the mentionable value of this option.Optional<CompletableFuture<User>>requestUserValue()Gets the user value of this option.-
Methods inherited from interface org.javacord.api.interaction.SlashCommandInteractionOptionsProvider
getFirstOption, getFirstOptionBooleanValue, getFirstOptionChannelValue, getFirstOptionIntValue, getFirstOptionMentionableValue, getFirstOptionRoleValue, getFirstOptionStringValue, getFirstOptionUserValue, getOptionBooleanValueByIndex, getOptionBooleanValueByName, getOptionByIndex, getOptionByName, getOptionChannelValueByIndex, getOptionChannelValueByName, getOptionIntValueByIndex, getOptionIntValueByName, getOptionMentionableValueByIndex, getOptionMentionableValueByName, getOptionRoleValueByIndex, getOptionRoleValueByName, getOptionStringValueByIndex, getOptionStringValueByName, getOptionUserValueByIndex, getOptionUserValueByName, getSecondOption, getSecondOptionBooleanValue, getSecondOptionChannelValue, getSecondOptionIntValue, getSecondOptionMentionableValue, getSecondOptionRoleValue, getSecondOptionStringValue, getSecondOptionUserValue, getThirdOption, getThirdOptionBooleanValue, getThirdOptionChannelValue, getThirdOptionIntValue, getThirdOptionMentionableValue, getThirdOptionRoleValue, getThirdOptionStringValue, getThirdOptionUserValue, requestFirstOptionMentionableValue, requestFirstOptionUserValue, requestOptionMentionableValueByIndex, requestOptionMentionableValueByName, requestOptionUserValueByIndex, requestOptionUserValueByName, requestSecondOptionMentionableValue, requestSecondOptionUserValue, requestThirdOptionMentionableValue, requestThirdOptionUserValue
-
-
-
-
Method Detail
-
getName
String getName()
Gets the name of the option.- Returns:
- The name.
-
isSubcommandOrGroup
default boolean isSubcommandOrGroup()
Checks if the option is a subcommand or group.If the option is a subcommand or group, it does have options but no value. If the option is not a subcommand or group, it does have a value but no options.
- Returns:
- If the option is a subcommand or group.
-
getStringValue
Optional<String> getStringValue()
Gets the string representation of this option value.If this option does not have a string value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The string value of this option.
-
getIntValue
Optional<Integer> getIntValue()
Gets the integer value of this option.If this option does not have an integer value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The integer value of this option.
-
getBooleanValue
Optional<Boolean> getBooleanValue()
Gets the boolean value of this option.If this option does not have a boolean value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The boolean value of this option.
-
getUserValue
Optional<User> getUserValue()
Gets the user value of this option. Note: This method only respects cached users. To fetch the user from Discord if the user is not cached, userequestUserValue().If this option does not have a user value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The user value of this option.
-
requestUserValue
Optional<CompletableFuture<User>> requestUserValue()
Gets the user value of this option.If this option does not have a user value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The user value of this option.
-
getChannelValue
Optional<ServerChannel> getChannelValue()
Gets the channel value of this option.If this option does not have a channel value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The channel value of this option.
-
getRoleValue
Optional<Role> getRoleValue()
Gets the role value of this option.If this option does not have a role value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The role value of this option.
-
getMentionableValue
Optional<Mentionable> getMentionableValue()
Gets the mentionable value of this option. Note: This method only respects cached users if the ID of the Mentionable belongs to a user. To fetch the user from Discord if the user is not cached, userequestMentionableValue().If this option does not have a mentionable value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The mentionable value of this option.
-
requestMentionableValue
Optional<CompletableFuture<Mentionable>> requestMentionableValue()
Gets the mentionable value of this option.If this option does not have a mentionable value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The mentionable value of this option.
-
getOptions
List<SlashCommandInteractionOption> getOptions()
Gets a list with all options of this option, if this option denotes a subcommand or group.If this option does not denote a subcommand or group, the list will be empty.
- Specified by:
getOptionsin interfaceSlashCommandInteractionOptionsProvider- Returns:
- A list with all options.
-
-