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
Inherited from
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.. | - | BaseCommand .components |
contexts | public | InteractionContextType [] | undefined | Beta The contexts this command can be used in API types are not finalized | - | BaseCommand .contexts |
defer | public | boolean | false | Whether the command response should be automatically deferred | - | BaseCommand .defer |
description | abstract | string | undefined | A description of the command | - | BaseCommand .description |
ephemeral | public | boolean | false | Whether the command response should be ephemeral | - | BaseCommand .ephemeral |
integrationTypes | public | ApplicationIntegrationType [] | undefined | Beta The places this command can be used in API types are not finalized | - | BaseCommand .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. | - | BaseCommand .modals |
name | abstract | string | undefined | The name of the command (e.g. "ping" for /ping) | - | BaseCommand .name |
subcommands | abstract | Command [] | undefined | The subcommands that the user can use | - | - |
type | public | ApplicationCommandType | ApplicationCommandType.ChatInput | The type of the command | BaseCommand .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
serializeOptions()
serializeOptions():
AddUndefinedToPossiblyUndefinedPropertiesOfInterface
<undefined
|APIApplicationCommandOption
[]>
Internal
Returns
AddUndefinedToPossiblyUndefinedPropertiesOfInterface
<undefined
| APIApplicationCommandOption
[]>