WOKCommands
Search
K

Runtime validations

You can provide your own runtime validations methods that will return a boolean for if the command should actually be ran or not.
JavaScript
TypeScript
command-starts-with-a.js
module.exports = (command, usage, prefix) => {
return command.commandName.startsWith("a");
};
command-starts-with-a.js
import { CommandUsage, Command } from "wokcommands";
export default (command: Command, usage: CommandUsage, prefix: string) => {
return command.commandName.startsWith("a");
};