AlexzanderFlores / WOKCommands

132 stars 61 forks source link

"syntaxError" proprety is not working #208

Closed LouisDiox closed 2 years ago

LouisDiox commented 2 years ago

The custom message of the "syntaxError" property is not displayed by the bot. Instead, the bot returns : "Incorrect usage! Please use [...]"

AlexzanderFlores commented 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".