Carbon
CoreClasses

BaseCommand

Represents the base data of a command that the user creates

Extended by

Constructors

new BaseCommand()

new BaseCommand(): BaseCommand

Returns

BaseCommand

Properties

PropertyModifierTypeDefault valueDescription
componentspublic() => BaseComponent[][]The components that the command is able to use. You pass these here so the handler can listen for them..
contextspublicInteractionContextType[]undefinedBeta The contexts this command can be used in API types are not finalized
deferpublicbooleanfalseWhether the command response should be automatically deferred
descriptionabstractstringundefinedA description of the command
ephemeralpublicbooleanfalseWhether the command response should be ephemeral
integrationTypespublicApplicationIntegrationType[]undefinedBeta The places this command can be used in API types are not finalized
modalspublic() => Modal[][]All the modals that the command is able to use. You pass these here so the handler can listen for them.
nameabstractstringundefinedThe name of the command (e.g. "ping" for /ping)
typeabstractApplicationCommandTypeundefinedThe type of the command

Methods

serialize()

serialize(): RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody

Internal

Serializes the command into a JSON object that can be sent to Discord

Returns

RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody


serializeOptions()

abstract serializeOptions(): AddUndefinedToPossiblyUndefinedPropertiesOfInterface<undefined | APIApplicationCommandOption[]>

Internal

Serializes the options of the command into a JSON object that can be sent to Discord

Returns

AddUndefinedToPossiblyUndefinedPropertiesOfInterface<undefined | APIApplicationCommandOption[]>

On this page

Edit on GitHub