Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"syntaxError" proprety is not working #208

Closed
LouisDiox opened this issue Feb 16, 2022 · 1 comment
Closed

"syntaxError" proprety is not working #208

LouisDiox opened this issue Feb 16, 2022 · 1 comment

Comments

@LouisDiox
Copy link

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

@AlexzanderFlores
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants