Syntax validations
You can provide your own syntax validations that will be ran against every command. This function should throw an error if the syntax is incorrect.
module.exports = (command) => {
const { commandObject, commandName } = command;
if (!commandObject.callback) {
throw new Error(
`Command "${commandName}" does not have a callback function.`
);
}
};
Last updated
Was this helpful?