Closed LouisDiox closed 2 years ago
Syntax errors now require an object to specify an error per language your bot supports. The documentation was outdated and has been updated to reflect this.
Example:
import { ICommand } from 'wokcommands'
export default {
category: 'Test',
description: 'Testing',
syntaxError: {
english: 'Syntax error',
},
maxArgs: 0,
callback: ({}) => {
return 'Pong'
},
} as ICommand
Running "!ping" will reply with "Pong" but running "!ping test" will reply with "Syntax error".
The custom message of the "syntaxError" property is not displayed by the bot. Instead, the bot returns : "Incorrect usage! Please use [...]"