class SlashCommandBuilder

export declare class SlashCommandBuilder

readonly
default_member_permissions : Permissions | null | undefined

Set of permissions represented as a bit set for the command

deprecatedreadonly
default_permission : boolean | undefined

Whether the command is enabled by default when the app is added to a guild

readonlyoptional
description_localizations? : LocalizationMap

The localized descriptions for this command

readonly
description : string

The description of this slash command

readonly
dm_permission : boolean | undefined

Indicates whether the command is available in DMs with the application, only for globally-scoped commands. By default, commands are visible.

readonlyoptional
name_localizations? : LocalizationMap

The localized names for this command

readonly
name : string

The name of this slash command

readonly
options : ToAPIApplicationCommandOptions[]

The options of this slash command

readonlyoptional
description_localizations? : LocalizationMap

Inherited from: SharedNameAndDescription

readonly
description : string

Inherited from: SharedNameAndDescription

readonlyoptional
name_localizations? : LocalizationMap

Inherited from: SharedNameAndDescription

readonly
name : string

Inherited from: SharedNameAndDescription

readonly
options : ToAPIApplicationCommandOptions[]

Inherited from: SharedSlashCommandOptions

Adds a new subcommand to this command

Adds a new subcommand group to this command

setDefaultMemberPermissions(
permissions: Permissions | bigint | number | null | undefined
) : this

Sets the default permissions a member should have in order to run the command.**Note:** You can set this to '0' to disable the command by default.

See also: https://discord.com/developers/docs/interactions/application-commands#permissions

deprecated
setDefaultPermission(
value: boolean
) : this

Sets whether the command is enabled by default when the application is added to a guild.**Note**: If set to false, you will have to later PUT the permissions for this command.

See also: https://discord.com/developers/docs/interactions/application-commands#permissions

setDMPermission(
enabled: boolean | null | undefined
) : this

Sets if the command is available in DMs with the application, only for globally-scoped commands. By default, commands are visible.

See also: https://discord.com/developers/docs/interactions/application-commands#permissions

Returns the final data that should be sent to Discord.**Note:** Calling this function will validate required properties based on their conditions.

addAttachmentOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds an attachment option

Inherited from: SharedSlashCommandOptions

addBooleanOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a boolean option

Inherited from: SharedSlashCommandOptions

addChannelOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a channel option

Inherited from: SharedSlashCommandOptions

addIntegerOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds an integer option

Inherited from: SharedSlashCommandOptions

addMentionableOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a mentionable option

Inherited from: SharedSlashCommandOptions

addNumberOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a number option

Inherited from: SharedSlashCommandOptions

addRoleOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a role option

Inherited from: SharedSlashCommandOptions

addStringOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a string option

Inherited from: SharedSlashCommandOptions

addUserOption() : ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this

Adds a user option

Inherited from: SharedSlashCommandOptions

setDescription(
description: string
) : this

Sets the description

Inherited from: SharedNameAndDescription

setDescriptionLocalization(
locale: LocaleString
localizedDescription: string | null
) : this

Sets a description localization

Inherited from: SharedNameAndDescription

setDescriptionLocalizations(
localizedDescriptions: LocalizationMap | null
) : this

Sets the description localizations

Inherited from: SharedNameAndDescription

setName(
name: string
) : this

Sets the name

Inherited from: SharedNameAndDescription

setNameLocalization(
locale: LocaleString
localizedName: string | null
) : this

Sets a name localization

Inherited from: SharedNameAndDescription

setNameLocalizations(
localizedNames: LocalizationMap | null
) : this

Sets the name localizations

Inherited from: SharedNameAndDescription