Abstract

CommandBuilder

export declare abstract class CommandBuilder<Command extends RESTPostAPIApplicationCommandsJSONBody> implements JSONEncodable<Command>
export declare abstract class CommandBuilder<Command extends RESTPostAPIApplicationCommandsJSONBody> implements JSONEncodable<Command>

No summary provided.

Implements

JSONEncodable<Command>
NameConstraintsOptionalDefaultDescription
CommandRESTPostAPIApplicationCommandsJSONBodyNoNone
ProtectedReadonly
clearDefaultMemberPermissions():this
Clears the default permissions a member should have in order to run the command.
setContexts(...contexts):this
Sets the contexts of this command.
NameTypeOptionalDescription
...contextsRestOrArray<InteractionContextType>NoThe contexts
setDefaultMemberPermissions(permissions):this
Sets the default permissions a member should have in order to run the command.
Remarks
You can set this to '0' to disable the command by default.
NameTypeOptionalDescription
permissionsPermissions | bigint | numberNoThe permissions bit field to set
setIntegrationTypes(...integrationTypes):this
Sets the integration types of this command.
NameTypeOptionalDescription
...integrationTypesRestOrArray<ApplicationIntegrationType>NoThe integration types
setNSFW(nsfw?):this
Sets whether this command is NSFW.
NameTypeOptionalDescription
nsfwbooleanYesWhether this command is NSFW
Abstract
toJSON(validationOverride?):Command
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
NameTypeOptionalDescription
validationOverridebooleanYesForce validation to run/not run regardless of your global preference