Skip to content

SlashCommandBuilder

Defined in: sdk/js/src/builders/command.ts:117

A slash command (CHAT_INPUT).

  • WithOptions

new SlashCommandBuilder(): SlashCommandBuilder

SlashCommandBuilder

WithOptions.constructor

description: string = ''

Defined in: sdk/js/src/builders/command.ts:27

SlashCommandSubcommandBuilder.description


optional descriptionLocalizations?: Record<string, string>

Defined in: sdk/js/src/builders/command.ts:29

WithOptions.descriptionLocalizations


name: string = ''

Defined in: sdk/js/src/builders/command.ts:26

CommandLike.name

SlashCommandSubcommandBuilder.name


optional nameLocalizations?: Record<string, string>

Defined in: sdk/js/src/builders/command.ts:28

WithOptions.nameLocalizations


readonly options: OptionBuilder[] = []

Defined in: sdk/js/src/builders/command.ts:63

WithOptions.options

addAttachmentOption(f): this

Defined in: sdk/js/src/builders/command.ts:78

OptionFn

this

WithOptions.addAttachmentOption


addBooleanOption(f): this

Defined in: sdk/js/src/builders/command.ts:72

OptionFn

this

WithOptions.addBooleanOption


addChannelOption(f): this

Defined in: sdk/js/src/builders/command.ts:74

OptionFn

this

WithOptions.addChannelOption


addIntegerOption(f): this

Defined in: sdk/js/src/builders/command.ts:71

OptionFn

this

WithOptions.addIntegerOption


addMentionableOption(f): this

Defined in: sdk/js/src/builders/command.ts:76

OptionFn

this

WithOptions.addMentionableOption


addNumberOption(f): this

Defined in: sdk/js/src/builders/command.ts:77

OptionFn

this

WithOptions.addNumberOption


addRoleOption(f): this

Defined in: sdk/js/src/builders/command.ts:75

OptionFn

this

WithOptions.addRoleOption


addStringOption(f): this

Defined in: sdk/js/src/builders/command.ts:70

OptionFn

this

WithOptions.addStringOption


addSubcommand(f): this

Defined in: sdk/js/src/builders/command.ts:121

(s) => SlashCommandSubcommandBuilder

this


addSubcommandGroup(f): this

Defined in: sdk/js/src/builders/command.ts:125

(g) => SlashCommandSubcommandGroupBuilder

this


addUserOption(f): this

Defined in: sdk/js/src/builders/command.ts:73

OptionFn

this

WithOptions.addUserOption


setDefaultMemberPermissions(bits): this

Defined in: sdk/js/src/builders/command.ts:130

Bits the invoker needs (0n = owner only; null = everyone, the default).

number | bigint

this


setDescription(description): this

Defined in: sdk/js/src/builders/command.ts:35

string

this

WithOptions.setDescription


setDescriptionLocalizations(map): this

Defined in: sdk/js/src/builders/command.ts:43

Record<string, string>

this

WithOptions.setDescriptionLocalizations


setName(name): this

Defined in: sdk/js/src/builders/command.ts:31

string

this

WithOptions.setName


setNameLocalizations(map): this

Defined in: sdk/js/src/builders/command.ts:39

Record<string, string>

this

WithOptions.setNameLocalizations


toJSON(): ApplicationCommand

Defined in: sdk/js/src/builders/command.ts:149

the WIT form.

ApplicationCommand


toWit(): ApplicationCommand

Defined in: sdk/js/src/builders/command.ts:135

ApplicationCommand

CommandLike.toWit