class ChatInputCommandBuilder

extends

ChatInputCommandBuilder_base
export declare class ChatInputCommandBuilder extends ChatInputCommandBuilder_base

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

protectedreadonly
data : CommandData

Inherited from: CommandBuilder

readonly
options : readonly ApplicationCommandOptionBase[]

Inherited from: SharedChatInputCommandOptions

Adds attachment options.

Inherited from: SharedChatInputCommandOptions

Adds boolean options.

Inherited from: SharedChatInputCommandOptions

Adds channel options.

Inherited from: SharedChatInputCommandOptions

Adds integer options.

Inherited from: SharedChatInputCommandOptions

Adds mentionable options.

Inherited from: SharedChatInputCommandOptions

Adds number options.

Inherited from: SharedChatInputCommandOptions

Adds role options.

Inherited from: SharedChatInputCommandOptions

Adds string options.

Inherited from: SharedChatInputCommandOptions

Adds subcommand groups to this command.

Inherited from: SharedChatInputCommandSubcommands

Adds subcommands to this command.

Inherited from: SharedChatInputCommandSubcommands

Adds user options.

Inherited from: SharedChatInputCommandOptions

clearDefaultMemberPermissions() : this

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

Inherited from: CommandBuilder

clearDescriptionLocalization(
locale: LocaleString
) : this

Clears a description localization for this command.

Inherited from: SharedNameAndDescription

clearDescriptionLocalizations() : this

Clears all description localizations for this command.

Inherited from: SharedNameAndDescription

clearNameLocalization(
locale: LocaleString
) : this

Clears a name localization for this command.

Inherited from: SharedName

clearNameLocalizations() : this

Clears all name localizations for this command.

Inherited from: SharedName

setContexts() : this

Sets the contexts of this command.

Inherited from: CommandBuilder

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

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

Inherited from: CommandBuilder

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

setDescription(
description: string
) : this

Sets the description of this command.

Inherited from: SharedNameAndDescription

setDescriptionLocalization(
locale: LocaleString
localizedDescription: string
) : this

Sets a description localization for this command.

Inherited from: SharedNameAndDescription

setDescriptionLocalizations(
localizedDescriptions: Partial<Record<LocaleString, string>>
) : this

Sets the description localizations for this command.

Inherited from: SharedNameAndDescription

setIntegrationTypes() : this

Sets the integration types of this command.

Inherited from: CommandBuilder

setName(
name: string
) : this

Sets the name of this command.

Inherited from: SharedName

setNameLocalization(
locale: LocaleString
localizedName: string
) : this

Sets a name localization for this command.

Inherited from: SharedName

setNameLocalizations(
localizedNames: Partial<Record<LocaleString, string>>
) : this

Sets the name localizations for this command.

Inherited from: SharedName

setNSFW(
nsfw?: boolean
) : this

Sets whether this command is NSFW.

Inherited from: CommandBuilder

spliceOptions(
index: number
deleteCount: number
) : this

Removes, replaces, or inserts options for this command.

Examples:Remove the first option:
actionRow.spliceOptions(0, 1);
Remove the first n options:
const n = 4;
actionRow.spliceOptions(0, n);
Remove the last option:
actionRow.spliceOptions(-1, 1);

Inherited from: SharedChatInputCommandOptions

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.