Carbon
Core/Classes

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

Constructor

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[]undefinedThe contexts this command can be used in-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[]undefinedThe places this command can be used in-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
permission?publicArrayOrSingle<bigint>undefinedThe default permission that a user needs to have to use this command. This can be overridden by server admins.-BaseCommand.permission
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