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
Inherited from
CommandWithSubcommands
.constructor
Properties
Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
---|---|---|---|---|---|---|
components | public | () => BaseComponent [] | [] | The components that the command is able to use. You pass these here so the handler can listen for them.. | - | CommandWithSubcommands .components |
contexts | public | InteractionContextType [] | undefined | Beta The contexts this command can be used in API types are not finalized | - | CommandWithSubcommands .contexts |
defer | public | boolean | false | Whether the command response should be automatically deferred | - | CommandWithSubcommands .defer |
description | abstract | string | undefined | A description of the command | - | CommandWithSubcommands .description |
ephemeral | public | boolean | false | Whether the command response should be ephemeral | - | CommandWithSubcommands .ephemeral |
integrationTypes | public | ApplicationIntegrationType [] | undefined | Beta The places this command can be used in API types are not finalized | - | CommandWithSubcommands .integrationTypes |
modals | public | () => Modal [] | [] | All the modals that the command is able to use. You pass these here so the handler can listen for them. | - | CommandWithSubcommands .modals |
name | abstract | string | undefined | The name of the command (e.g. "ping" for /ping) | - | CommandWithSubcommands .name |
subcommandGroups | abstract | CommandWithSubcommands [] | undefined | The subcommands that the user can use | - | - |
subcommands | public | Command [] | [] | The subcommands that the user can use | CommandWithSubcommands .subcommands | - |
type | public | ApplicationCommandType | ApplicationCommandType.ChatInput | The 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
)[]