Carbon
CoreClasses

CommandWithSubcommands

Represents a subcommand command that the user creates. You make this instead of a Command class when you want to have subcommands in your options.

Extends

Extended by

Constructors

new CommandWithSubcommands()

new CommandWithSubcommands(): CommandWithSubcommands

Returns

CommandWithSubcommands

Inherited from

BaseCommand.constructor

Properties

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

Methods

serialize()

serialize(): RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody

Internal

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

Returns

RESTPostAPIChatInputApplicationCommandsJSONBody | RESTPostAPIContextMenuApplicationCommandsJSONBody

Inherited from

BaseCommand.serialize


serializeOptions()

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

Internal

Returns

AddUndefinedToPossiblyUndefinedPropertiesOfInterface<undefined | APIApplicationCommandOption[]>

Overrides

BaseCommand.serializeOptions

On this page

Edit on GitHub