Definition
createBotCommand(commandName, handler, options)
Creates a simple bot command.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
commandName | string | none | The name of the command. | |
handler | (params: string[], context: BotCommandContext) => void | Promise<void> | none | The execution handler that should be called when the command is sent. | |
options | CreateBotCommandOptions | <complex> | see below | |
options.aliases | string[] | none | Alternative names for the command that can be used to call it. | |
options.cooldownCleanupRate | number | none | The interval in which expired cooldown data should be cleared, in seconds. Defaults to 10 minutes. | |
options.globalCooldown | number | none | The cooldown of the command for everyone, in seconds. | |
options.userCooldown | number | none | The cooldown of the command per user, in seconds. |
Return type: BotCommand