CreateSlashCommand
Defined in: packages/builders/src/commands.ts:31
Builds Discord application command payloads.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CreateSlashCommand():
CreateSlashCommand
Returns
Section titled “Returns”CreateSlashCommand
Methods
Section titled “Methods”addAttachmentOption()
Section titled “addAttachmentOption()”addAttachmentOption(
configure):this
Defined in: packages/builders/src/commands.ts:122
Adds an attachment option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateAttachmentOption
Returns
Section titled “Returns”this
addBooleanOption()
Section titled “addBooleanOption()”addBooleanOption(
configure):this
Defined in: packages/builders/src/commands.ts:92
Adds a boolean option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateBooleanOption
Returns
Section titled “Returns”this
addChannelOption()
Section titled “addChannelOption()”addChannelOption(
configure):this
Defined in: packages/builders/src/commands.ts:104
Adds a channel option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateChannelOption
Returns
Section titled “Returns”this
addIntegerOption()
Section titled “addIntegerOption()”addIntegerOption(
configure):this
Defined in: packages/builders/src/commands.ts:80
Adds an integer option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateIntegerOption
Returns
Section titled “Returns”this
addMentionableOption()
Section titled “addMentionableOption()”addMentionableOption(
configure):this
Defined in: packages/builders/src/commands.ts:116
Adds a mentionable option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateMentionableOption
Returns
Section titled “Returns”this
addNumberOption()
Section titled “addNumberOption()”addNumberOption(
configure):this
Defined in: packages/builders/src/commands.ts:86
Adds a number option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateNumberOption
Returns
Section titled “Returns”this
addRoleOption()
Section titled “addRoleOption()”addRoleOption(
configure):this
Defined in: packages/builders/src/commands.ts:110
Adds a role option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateRoleOption
Returns
Section titled “Returns”this
addStringOption()
Section titled “addStringOption()”addStringOption(
configure):this
Defined in: packages/builders/src/commands.ts:74
Adds a string option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateStringOption
Returns
Section titled “Returns”this
addSubcommand()
Section titled “addSubcommand()”addSubcommand(
configure):this
Defined in: packages/builders/src/commands.ts:128
Adds a subcommand.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateSubcommand
Returns
Section titled “Returns”this
addSubcommandGroup()
Section titled “addSubcommandGroup()”addSubcommandGroup(
configure):this
Defined in: packages/builders/src/commands.ts:134
Adds a subcommand group.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateSubcommandGroup
Returns
Section titled “Returns”this
addUserOption()
Section titled “addUserOption()”addUserOption(
configure):this
Defined in: packages/builders/src/commands.ts:98
Adds a user option.
Parameters
Section titled “Parameters”configure
Section titled “configure”(option) => CreateUserOption
Returns
Section titled “Returns”this
setContexts()
Section titled “setContexts()”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.
Parameters
Section titled “Parameters”contexts
Section titled “contexts”…number[]
Returns
Section titled “Returns”this
Throws
Section titled “Throws”For any other value.
setDefaultMemberPermissions()
Section titled “setDefaultMemberPermissions()”setDefaultMemberPermissions(
permissions):this
Defined in: packages/builders/src/commands.ts:61
Sets command default member permissions.
Parameters
Section titled “Parameters”permissions
Section titled “permissions”string | number | bigint | null
Returns
Section titled “Returns”this
setDescription()
Section titled “setDescription()”setDescription(
description):this
Defined in: packages/builders/src/commands.ts:40
Sets the command description.
Parameters
Section titled “Parameters”description
Section titled “description”string
Returns
Section titled “Returns”this
setIntegrationTypes()
Section titled “setIntegrationTypes()”setIntegrationTypes(…
types):this
Defined in: packages/builders/src/commands.ts:69
Sets command integration types.
Parameters
Section titled “Parameters”…number[]
Returns
Section titled “Returns”this
setName()
Section titled “setName()”setName(
name):this
Defined in: packages/builders/src/commands.ts:34
Sets the command name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
setNsfw()
Section titled “setNsfw()”setNsfw(
nsfw?):this
Defined in: packages/builders/src/commands.ts:57
Sets whether the command is NSFW.
Parameters
Section titled “Parameters”boolean = true
Returns
Section titled “Returns”this
setNSFW()
Section titled “setNSFW()”setNSFW(
nsfw?):this
Defined in: packages/builders/src/commands.ts:52
Sets whether the command is NSFW.
Parameters
Section titled “Parameters”boolean = true
Returns
Section titled “Returns”this
toJSON()
Section titled “toJSON()”toJSON():
Record<string,unknown>
Defined in: packages/builders/src/commands.ts:140
Serializes the command payload.
Returns
Section titled “Returns”Record<string, unknown>