Interface SlashCommandInteractionOption

    • 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, use requestUserValue().

        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, use requestMentionableValue().

        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.