BaseCommand
Represents the base data of a command that the user creates
Extended by
Constructors
Constructor
new BaseCommand():
BaseCommand
Returns
BaseCommand
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 | The contexts this command can be used in |
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 | The places this command can be used in |
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) |
permission? | public | ArrayOrSingle <bigint > | undefined | The default permission that a user needs to have to use this command. This can be overridden by server admins. |
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
[]>