Carbon
CoreClasses

CommandWithSubcommandGroups

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

Extends

Constructors

new CommandWithSubcommandGroups()

new CommandWithSubcommandGroups(): CommandWithSubcommandGroups

Returns

CommandWithSubcommandGroups

Inherited from

CommandWithSubcommands.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..-CommandWithSubcommands.components
contextspublicInteractionContextType[]undefinedBeta The contexts this command can be used in API types are not finalized-CommandWithSubcommands.contexts
deferpublicbooleanfalseWhether the command response should be automatically deferred-CommandWithSubcommands.defer
descriptionabstractstringundefinedA description of the command-CommandWithSubcommands.description
ephemeralpublicbooleanfalseWhether the command response should be ephemeral-CommandWithSubcommands.ephemeral
integrationTypespublicApplicationIntegrationType[]undefinedBeta The places this command can be used in API types are not finalized-CommandWithSubcommands.integrationTypes
modalspublic() => Modal[][]All the modals that the command is able to use. You pass these here so the handler can listen for them.-CommandWithSubcommands.modals
nameabstractstringundefinedThe name of the command (e.g. "ping" for /ping)-CommandWithSubcommands.name
subcommandGroupsabstractCommandWithSubcommands[]undefinedThe subcommands that the user can use--
subcommandspublicCommand[][]The subcommands that the user can useCommandWithSubcommands.subcommands-
typepublicApplicationCommandTypeApplicationCommandType.ChatInputThe type of the command-CommandWithSubcommands.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

CommandWithSubcommands.serialize


serializeOptions()

serializeOptions(): (APIApplicationCommandSubcommandGroupOption | APIApplicationCommandSubcommandOption)[]

Internal

Returns

(APIApplicationCommandSubcommandGroupOption | APIApplicationCommandSubcommandOption)[]

Overrides

CommandWithSubcommands.serializeOptions

On this page

Edit on GitHub