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 Details

    • ApplicationCommandInteractionOption

      public ApplicationCommandInteractionOption(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandInteractionOptionData data, @Nullable Long guildId, @Nullable discord4j.discordjson.json.ApplicationCommandInteractionResolvedData resolved)
      Constructs an ApplicationCommandInteractionOption with an associated GatewayDiscordClient and Discord data.
      Parameters:
      gateway - The GatewayDiscordClient associated to this object, must be non-null.
      data - The raw data as represented by Discord, must be non-null.
  • Method Details

    • getName

      public String 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

      public GatewayDiscordClient getClient()
      Description copied from interface: DiscordObject
      Returns the GatewayDiscordClient that created this object. Methods in it are exclusively based on the entity cache or Store in use. Refer to calling getClient().rest() to access a DiscordClient that is capable of requesting entities directly from the REST API.
      Specified by:
      getClient in interface DiscordObject
      Returns:
      The GatewayDiscordClient associated to this object.