Optional
Readonly
contextsThe contexts for this command.
Readonly
default_The set of permissions represented as a bit set for the command.
Readonly
default_Whether this command is enabled by default when the application is added to a guild.
Use setDefaultMemberPermissions or setDMPermission instead.
Readonly
dm_Indicates whether the command is available in direct messages with the application.
By default, commands are visible. This property is only for global commands.
Use contexts instead.
Optional
Readonly
integration_The integration types for this command.
Readonly
nameThe name of this command.
Optional
Readonly
name_The name localizations of this command.
Readonly
typeThe type of this command.
Sets the contexts of this command.
Rest
...contexts: RestOrArray<InteractionContextType>The contexts
Sets if the command is available in direct messages with the application.
Whether the command should be enabled in direct messages
By default, commands are visible. This method is only for global commands.
https://discord.com/developers/docs/interactions/application-commands#permissions
Use setContexts instead.
Sets the default permissions a member should have in order to run this command.
The permissions bit field to set
You can set this to '0'
to disable the command by default.
https://discord.com/developers/docs/interactions/application-commands#permissions
Sets whether the command is enabled by default when the application is added to a guild.
Whether to enable this command by default
If set to false
, you will have to later PUT
the permissions for this command.
https://discord.com/developers/docs/interactions/application-commands#permissions
Use setDefaultMemberPermissions or setDMPermission instead.
Sets integration types of this command.
Rest
...integrationTypes: RestOrArray<ApplicationIntegrationType>The integration types
Sets the name of this command.
The name to use
Sets a name localization for this command.
The locale to set
The localized name for the given locale
Sets the name localizations for this command.
The object of localized names to set
Sets the type of this command.
The type to use
Serializes this builder to API-compatible JSON data.
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.
Generated using TypeDoc
A builder that creates API-compatible JSON data for context menu commands.