class SlashCommandBuilder

export declare class SlashCommandBuilder

A builder that creates API-compatible JSON data for slash commands.

readonly
default_member_permissions : Permissions_2 | null | undefined

The set of permissions represented as a bit set for the command.

deprecatedreadonly
default_permission : boolean | undefined

Whether this command is enabled by default when the application is added to a guild.

readonlyoptional
description_localizations? : LocalizationMap

The description localizations of this command.

readonly
description : string

The description of this command.

readonly
dm_permission : boolean | undefined

Indicates whether the command is available in direct messages with the application.

readonlyoptional
name_localizations? : LocalizationMap

The name localizations of this command.

readonly
name : string

The name of this command.

readonly
nsfw : boolean | undefined

Whether this command is NSFW.

readonly
options : ToAPIApplicationCommandOptions[]

The options of this command.

readonlyoptional
description_localizations? : LocalizationMap

The description localizations of this command.

Inherited from: SharedNameAndDescription

readonly
description : string

The description of this command.

Inherited from: SharedNameAndDescription

readonlyoptional
name_localizations? : LocalizationMap

The name localizations of this command.

Inherited from: SharedNameAndDescription

readonly
name : string

The name of this command.

Inherited from: SharedNameAndDescription

Adds a new subcommand to this command.

Adds a new subcommand group to this command.

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

Sets the default permissions a member should have in order to run the command.

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

deprecated
setDefaultPermission(
value: boolean
) : this

Sets whether the command is enabled by default when the application is added to a guild.

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

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

Sets if the command is available in direct messages with the application.

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

setNSFW(
nsfw?: boolean
) : this

Sets whether this command is NSFW.

Serializes this builder to API-compatible JSON data.

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

Adds an attachment option.

Inherited from: SharedSlashCommandOptions

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

Adds a boolean option.

Inherited from: SharedSlashCommandOptions

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

Adds a channel option.

Inherited from: SharedSlashCommandOptions

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

Adds an integer option.

Inherited from: SharedSlashCommandOptions

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

Adds a mentionable option.

Inherited from: SharedSlashCommandOptions

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

Adds a number option.

Inherited from: SharedSlashCommandOptions

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

Adds a role option.

Inherited from: SharedSlashCommandOptions

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

Adds a string option.

Inherited from: SharedSlashCommandOptions

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

Adds a user option.

Inherited from: SharedSlashCommandOptions

setDescription(
description: string
) : this

Sets the description of this command.

Inherited from: SharedNameAndDescription

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

Sets a description localization for this command.

Inherited from: SharedNameAndDescription

setDescriptionLocalizations(
localizedDescriptions: LocalizationMap | null
) : this

Sets the description localizations for this command.

Inherited from: SharedNameAndDescription

setName(
name: string
) : this

Sets the name of this command.

Inherited from: SharedNameAndDescription

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

Sets a name localization for this command.

Inherited from: SharedNameAndDescription

setNameLocalizations(
localizedNames: LocalizationMap | null
) : this

Sets the name localizations for this command.

Inherited from: SharedNameAndDescription