Class ApplicationCommandInteractionOption

    • Constructor Detail

      • ApplicationCommandInteractionOption

        public ApplicationCommandInteractionOption​(GatewayDiscordClient gateway,
                                                   discord4j.discordjson.json.ApplicationCommandInteractionOptionData data,
                                                   @Nullable
                                                   Long guildId)
        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 Detail

      • getName

        public String getName()
        Gets the name of the option.
        Returns:
        The name of the option.
      • getOptions

        public List<ApplicationCommandInteractionOption> 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

        public Optional<ApplicationCommandInteractionOption> getOption​(String name)
        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.