The Validate Function

The validate function does exactly what it sounds like it will do. It validates the command in any way that you provide in the validate function. You can return either a string, as shown above, to use in your "onError" property, or return a boolean/undefined to default to a generic error code of "INVALID_ARGUMENT". Whatever string is returned from the validate function is passed into the "onError" function as the parameter "error".

Parameter Types

  • message: import("discord.js").Message

  • args: Array<string>

  • client: CDClient

  • prefix: string

  • language: keyof import("cdcommands/src/Base/Handling/Languages.json")