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 java.util.Optional<Attachment>getAttachmentValue()Gets the attachment value of this option.java.util.Optional<java.lang.Boolean>getBooleanValue()Gets the boolean value of this option.java.util.Optional<ServerChannel>getChannelValue()Gets the channel value of this option.java.util.Optional<java.lang.Double>getDecimalValue()Gets the decimal value of this option.java.util.Optional<java.lang.Long>getLongValue()Gets the long value of this option.java.util.Optional<Mentionable>getMentionableValue()Gets the mentionable value of this option.java.lang.StringgetName()Gets the name of the option.java.util.List<SlashCommandInteractionOption>getOptions()Gets all options of this option, if this option denotes a subcommand or group.java.util.Optional<Role>getRoleValue()Gets the role value of this option.java.util.Optional<java.lang.String>getStringRepresentationValue()Gets the string representation value of this option.java.util.Optional<java.lang.String>getStringValue()Gets the string value of this option.java.util.Optional<User>getUserValue()Gets the user value of this option.java.util.Optional<java.lang.Boolean>isFocused()Checks if this option is the currently focused option for autocomplete.default booleanisSubcommandOrGroup()Checks if the option is a subcommand or group.java.util.Optional<java.util.concurrent.CompletableFuture<Mentionable>>requestMentionableValue()Gets the mentionable value of this option.java.util.Optional<java.util.concurrent.CompletableFuture<User>>requestUserValue()Gets the user value of this option.-
Methods inherited from interface org.javacord.api.interaction.SlashCommandInteractionOptionsProvider
getArgumentAttachmentValueByIndex, getArgumentAttachmentValueByName, getArgumentBooleanValueByIndex, getArgumentBooleanValueByName, getArgumentByIndex, getArgumentByName, getArgumentChannelValueByIndex, getArgumentChannelValueByName, getArgumentDecimalValueByIndex, getArgumentDecimalValueByName, getArgumentLongValueByIndex, getArgumentLongValueByName, getArgumentMentionableValueByIndex, getArgumentMentionableValueByName, getArgumentRoleValueByIndex, getArgumentRoleValueByName, getArguments, getArgumentStringRepresentationValueByIndex, getArgumentStringRepresentationValueByName, getArgumentStringValueByIndex, getArgumentStringValueByName, getArgumentUserValueByIndex, getArgumentUserValueByName, getOptionByIndex, getOptionByName, requestArgumentMentionableValueByIndex, requestArgumentMentionableValueByName, requestArgumentUserValueByIndex, requestArgumentUserValueByName
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the option.- Returns:
- The name.
-
isFocused
java.util.Optional<java.lang.Boolean> isFocused()
Checks if this option is the currently focused option for autocomplete.Returns an empty optional if the invoked command is not autocompletable at all.
- Returns:
- Whether this option is the currently focused option for autocomplete.
-
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.
-
getStringRepresentationValue
java.util.Optional<java.lang.String> getStringRepresentationValue()
Gets the string representation value of this option.This will always be present unless the option is a subcommand or subcommand group.
- Returns:
- The string representation value of this option.
-
getStringValue
java.util.Optional<java.lang.String> getStringValue()
Gets the string value of this option.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.
-
getLongValue
java.util.Optional<java.lang.Long> getLongValue()
Gets the long value of this option.If this option does not have a long value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The long value of this option.
-
getBooleanValue
java.util.Optional<java.lang.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
java.util.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
java.util.Optional<java.util.concurrent.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
java.util.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.
-
getAttachmentValue
java.util.Optional<Attachment> getAttachmentValue()
Gets the attachment value of this option.If this option does not have an attachment value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The attachment value of this option.
-
getRoleValue
java.util.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
java.util.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.
-
getDecimalValue
java.util.Optional<java.lang.Double> getDecimalValue()
Gets the decimal value of this option.If this option does not have a decimal value or the option itself is a subcommand or group, the optional will be empty.
- Returns:
- The decimal value of this option.
-
requestMentionableValue
java.util.Optional<java.util.concurrent.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
java.util.List<SlashCommandInteractionOption> getOptions()
Gets 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:
- All options.
-
-