Skip to content

CreateSlashCommand

Defined in: packages/builders/src/commands.ts:31

Builds Discord application command payloads.

new CreateSlashCommand(): CreateSlashCommand

CreateSlashCommand

addAttachmentOption(configure): this

Defined in: packages/builders/src/commands.ts:122

Adds an attachment option.

(option) => CreateAttachmentOption

this


addBooleanOption(configure): this

Defined in: packages/builders/src/commands.ts:92

Adds a boolean option.

(option) => CreateBooleanOption

this


addChannelOption(configure): this

Defined in: packages/builders/src/commands.ts:104

Adds a channel option.

(option) => CreateChannelOption

this


addIntegerOption(configure): this

Defined in: packages/builders/src/commands.ts:80

Adds an integer option.

(option) => CreateIntegerOption

this


addMentionableOption(configure): this

Defined in: packages/builders/src/commands.ts:116

Adds a mentionable option.

(option) => CreateMentionableOption

this


addNumberOption(configure): this

Defined in: packages/builders/src/commands.ts:86

Adds a number option.

(option) => CreateNumberOption

this


addRoleOption(configure): this

Defined in: packages/builders/src/commands.ts:110

Adds a role option.

(option) => CreateRoleOption

this


addStringOption(configure): this

Defined in: packages/builders/src/commands.ts:74

Adds a string option.

(option) => CreateStringOption

this


addSubcommand(configure): this

Defined in: packages/builders/src/commands.ts:128

Adds a subcommand.

(option) => CreateSubcommand

this


addSubcommandGroup(configure): this

Defined in: packages/builders/src/commands.ts:134

Adds a subcommand group.

(option) => CreateSubcommandGroup

this


addUserOption(configure): this

Defined in: packages/builders/src/commands.ts:98

Adds a user option.

(option) => CreateUserOption

this


setContexts(…contexts): this

Defined in: packages/builders/src/commands.ts:46

Sets where the command can be used: 0 guilds, 1 the bot’s DMs, 2 other DMs.

…number[]

this

For any other value.


setDefaultMemberPermissions(permissions): this

Defined in: packages/builders/src/commands.ts:61

Sets command default member permissions.

string | number | bigint | null

this


setDescription(description): this

Defined in: packages/builders/src/commands.ts:40

Sets the command description.

string

this


setIntegrationTypes(…types): this

Defined in: packages/builders/src/commands.ts:69

Sets command integration types.

…number[]

this


setName(name): this

Defined in: packages/builders/src/commands.ts:34

Sets the command name.

string

this


setNsfw(nsfw?): this

Defined in: packages/builders/src/commands.ts:57

Sets whether the command is NSFW.

boolean = true

this


setNSFW(nsfw?): this

Defined in: packages/builders/src/commands.ts:52

Sets whether the command is NSFW.

boolean = true

this


toJSON(): Record<string, unknown>

Defined in: packages/builders/src/commands.ts:140

Serializes the command payload.

Record<string, unknown>