CoreClasses
BaseCommand
Represents the base data of a command that the user creates
Extended by
Constructors
new BaseCommand()
new BaseCommand():
BaseCommand
Returns
Properties
Property | Modifier | Type | Default value | Description |
---|---|---|---|---|
components | public | () => BaseComponent [] | [] | The components that the command is able to use. You pass these here so the handler can listen for them.. |
contexts | public | InteractionContextType [] | undefined | Beta The contexts this command can be used in API types are not finalized |
defer | public | boolean | false | Whether the command response should be automatically deferred |
description | abstract | string | undefined | A description of the command |
ephemeral | public | boolean | false | Whether the command response should be ephemeral |
integrationTypes | public | ApplicationIntegrationType [] | undefined | Beta The places this command can be used in API types are not finalized |
modals | public | () => Modal [] | [] | All the modals that the command is able to use. You pass these here so the handler can listen for them. |
name | abstract | string | undefined | The name of the command (e.g. "ping" for /ping) |
type | abstract | ApplicationCommandType | undefined | The type of the command |
Methods
serialize()
serialize():
RESTPostAPIChatInputApplicationCommandsJSONBody
|RESTPostAPIContextMenuApplicationCommandsJSONBody
Internal
Serializes the command into a JSON object that can be sent to Discord
Returns
RESTPostAPIChatInputApplicationCommandsJSONBody
| RESTPostAPIContextMenuApplicationCommandsJSONBody
serializeOptions()
abstract
serializeOptions():AddUndefinedToPossiblyUndefinedPropertiesOfInterface
<undefined
|APIApplicationCommandOption
[]>
Internal
Serializes the options of the command into a JSON object that can be sent to Discord
Returns
AddUndefinedToPossiblyUndefinedPropertiesOfInterface
<undefined
| APIApplicationCommandOption
[]>