Overview
Methods
For basic commands, it is recommended to use the createBotCommand helper instead.
Properties
Methods
canExecute(channelId, userId)
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channelId | string | none | none | |
userId | string | none | none |
Return type: boolean
execute(params, context)
Handles the command execution.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
params | string[] | none | The parameters returned by the matcher. | |
context | BotCommandContext | none | The command context. |
Return type: void | Promise<void>
match(line, prefix)
Checks whether a message matches this command, and if it does, returns the parameters to pass to the execution handler.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
line | string | none | The text of the message. | |
prefix | string | none | The command prefix set in the bot configuration. |
Return type: string[] | null