Package discord4j.core.object.command
Class ApplicationCommandInteractionOption
java.lang.Object
discord4j.core.object.command.ApplicationCommandInteractionOption
- All Implemented Interfaces:
DiscordObject
@Experimental
public class ApplicationCommandInteractionOption
extends Object
implements DiscordObject
A Discord application command interaction.
- See Also:
-
Constructor Summary
ConstructorDescriptionApplicationCommandInteractionOption
(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandInteractionOptionData data, Long guildId, discord4j.discordjson.json.ApplicationCommandInteractionResolvedData resolved) Constructs anApplicationCommandInteractionOption
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptionReturns theGatewayDiscordClient
that created this object.getName()
Gets the name of the option.Gets the option corresponding to the provided name, if present.Gets the options, present if this option is a group or subcommand.getType()
Gets the type of this option.getValue()
boolean
Whether this option is currently focused or not.
-
Constructor Details
-
ApplicationCommandInteractionOption
public ApplicationCommandInteractionOption(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandInteractionOptionData data, @Nullable Long guildId, @Nullable discord4j.discordjson.json.ApplicationCommandInteractionResolvedData resolved) Constructs anApplicationCommandInteractionOption
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
getName
Gets the name of the option.- Returns:
- The name of the option.
-
getValue
-
getType
Gets the type of this option.- Returns:
- The type of this option.
-
getOptions
Gets the options, present if this option is a group or subcommand.- Returns:
- The options, present if this option is a group or subcommand.
-
getOption
Gets the option corresponding to the provided name, if present.- Parameters:
name
- The name of the option.- Returns:
- The option corresponding to the provided name, if present.
-
isFocused
public boolean isFocused()Whether this option is currently focused or not.This will always return false unless this option is from an autocomplete interaction.
- Returns:
- Whether this option is currently focused or not.
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-