SlashCommand
An application command invoked by typing / in a text channel.
Parameters
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| name | String | none | ✅ | Command name |
| description | String | none | ✅ | Command description |
| options | Array | none | Command options | |
| cooldown | Number | none | Command cooldown defined in milliseconds | |
| defaultMemberPermissions | PermissionsBitField | 0 | The permissions this command will have when your app is installed |
Methods
onCooldown()
Runs if this command is on cooldown. Great for giving each command a unique cooldown message.
| Parameter | Type | Description |
|---|---|---|
| interaction | ChatInputCommandInteraction | The interaction that invoked this command |
| cooldown | Cooldown | Contains the member and timestamp from the last time the command was used |
| remaining | String | Time remaining until the cooldown expires |
run()
Runs when this command is invoked.
| Parameter | Type | Description |
|---|---|---|
| interaction | ChatInputCommandInteraction | The interaction that invoked this command |