Discord.https - v3.0.16
    Preparing search index...

    Interface SlashCommandOptionsOnlyBuilder

    An interface specifically for slash command options.

    interface SlashCommandOptionsOnlyBuilder {
        contexts?: InteractionContextType[];
        default_member_permissions: undefined | null | string;
        default_permission: undefined | boolean;
        description: string;
        description_localizations?: Partial<Record<Locale, null | string>>;
        dm_permission: undefined | boolean;
        integration_types?: ApplicationIntegrationType[];
        name: string;
        name_localizations?: Partial<Record<Locale, null | string>>;
        nsfw: undefined | boolean;
        options: ToAPIApplicationCommandOptions[];
        addAttachmentOption(
            input:
                | SlashCommandAttachmentOption
                | (
                    (
                        builder: SlashCommandAttachmentOption,
                    ) => SlashCommandAttachmentOption
                ),
        ): SlashCommandOptionsOnlyBuilder;
        addBooleanOption(
            input:
                | SlashCommandBooleanOption
                | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),
        ): SlashCommandOptionsOnlyBuilder;
        addChannelOption(
            input:
                | SlashCommandChannelOption
                | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),
        ): SlashCommandOptionsOnlyBuilder;
        addIntegerOption(
            input:
                | SlashCommandIntegerOption
                | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption),
        ): SlashCommandOptionsOnlyBuilder;
        addMentionableOption(
            input:
                | SlashCommandMentionableOption
                | (
                    (
                        builder: SlashCommandMentionableOption,
                    ) => SlashCommandMentionableOption
                ),
        ): SlashCommandOptionsOnlyBuilder;
        addNumberOption(
            input:
                | SlashCommandNumberOption
                | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption),
        ): SlashCommandOptionsOnlyBuilder;
        addRoleOption(
            input:
                | SlashCommandRoleOption
                | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption),
        ): SlashCommandOptionsOnlyBuilder;
        addStringOption(
            input:
                | SlashCommandStringOption
                | ((builder: SlashCommandStringOption) => SlashCommandStringOption),
        ): SlashCommandOptionsOnlyBuilder;
        addUserOption(
            input:
                | SlashCommandUserOption
                | ((builder: SlashCommandUserOption) => SlashCommandUserOption),
        ): SlashCommandOptionsOnlyBuilder;
        setContexts(...contexts: RestOrArray<InteractionContextType>): this;
        setDefaultMemberPermissions(
            permissions: undefined | null | string | number | bigint,
        ): this;
        setDefaultPermission(value: boolean): this;
        setDescription(description: string): this;
        setDescriptionLocalization(
            locale:
                | "id"
                | "en-US"
                | "en-GB"
                | "bg"
                | "zh-CN"
                | "zh-TW"
                | "hr"
                | "cs"
                | "da"
                | "nl"
                | "fi"
                | "fr"
                | "de"
                | "el"
                | "hi"
                | "hu"
                | "it"
                | "ja"
                | "ko"
                | "lt"
                | "no"
                | "pl"
                | "pt-BR"
                | "ro"
                | "ru"
                | "es-ES"
                | "es-419"
                | "sv-SE"
                | "th"
                | "tr"
                | "uk"
                | "vi",
            localizedDescription: null | string,
        ): this;
        setDescriptionLocalizations(
            localizedDescriptions: null | Partial<Record<Locale, null | string>>,
        ): this;
        setDMPermission(enabled: undefined | null | boolean): this;
        setIntegrationTypes(
            ...integrationTypes: RestOrArray<ApplicationIntegrationType>,
        ): this;
        setName(name: string): this;
        setNameLocalization(
            locale:
                | "id"
                | "en-US"
                | "en-GB"
                | "bg"
                | "zh-CN"
                | "zh-TW"
                | "hr"
                | "cs"
                | "da"
                | "nl"
                | "fi"
                | "fr"
                | "de"
                | "el"
                | "hi"
                | "hu"
                | "it"
                | "ja"
                | "ko"
                | "lt"
                | "no"
                | "pl"
                | "pt-BR"
                | "ro"
                | "ru"
                | "es-ES"
                | "es-419"
                | "sv-SE"
                | "th"
                | "tr"
                | "uk"
                | "vi",
            localizedName: null | string,
        ): this;
        setNameLocalizations(
            localizedNames: null | Partial<Record<Locale, null | string>>,
        ): this;
        setNSFW(nsfw?: boolean): this;
        toJSON(): RESTPostAPIChatInputApplicationCommandsJSONBody;
    }

    Hierarchy (View Summary)

    Index

    Properties

    default_member_permissions: undefined | null | string
    default_permission: undefined | boolean
    description: string

    The description of this command.

    description_localizations?: Partial<Record<Locale, null | string>>

    The description localizations of this command.

    dm_permission: undefined | boolean

    Use SharedSlashCommand.contexts instead.

    integration_types?: ApplicationIntegrationType[]
    name: string

    The name of this command.

    name_localizations?: Partial<Record<Locale, null | string>>

    The name localizations of this command.

    nsfw: undefined | boolean

    Methods

    • Sets the description of this command.

      Parameters

      • description: string

        The description to use

      Returns this

    • Sets a description localization for this command.

      Parameters

      • locale:
            | "id"
            | "en-US"
            | "en-GB"
            | "bg"
            | "zh-CN"
            | "zh-TW"
            | "hr"
            | "cs"
            | "da"
            | "nl"
            | "fi"
            | "fr"
            | "de"
            | "el"
            | "hi"
            | "hu"
            | "it"
            | "ja"
            | "ko"
            | "lt"
            | "no"
            | "pl"
            | "pt-BR"
            | "ro"
            | "ru"
            | "es-ES"
            | "es-419"
            | "sv-SE"
            | "th"
            | "tr"
            | "uk"
            | "vi"

        The locale to set

      • localizedDescription: null | string

        The localized description for the given locale

      Returns this

    • Sets the description localizations for this command.

      Parameters

      • localizedDescriptions: null | Partial<Record<Locale, null | string>>

        The object of localized descriptions to set

      Returns this

    • Sets the name of this command.

      Parameters

      • name: string

        The name to use

      Returns this

    • Sets a name localization for this command.

      Parameters

      • locale:
            | "id"
            | "en-US"
            | "en-GB"
            | "bg"
            | "zh-CN"
            | "zh-TW"
            | "hr"
            | "cs"
            | "da"
            | "nl"
            | "fi"
            | "fr"
            | "de"
            | "el"
            | "hi"
            | "hu"
            | "it"
            | "ja"
            | "ko"
            | "lt"
            | "no"
            | "pl"
            | "pt-BR"
            | "ro"
            | "ru"
            | "es-ES"
            | "es-419"
            | "sv-SE"
            | "th"
            | "tr"
            | "uk"
            | "vi"

        The locale to set

      • localizedName: null | string

        The localized name for the given locale

      Returns this

    • Sets the name localizations for this command.

      Parameters

      • localizedNames: null | Partial<Record<Locale, null | string>>

        The object of localized names to set

      Returns this

    • Sets whether this command is NSFW.

      Parameters

      • Optionalnsfw: boolean

        Whether this command is NSFW

      Returns this