WOKCommands
  • WOKCommands Documentation
  • Useful Links
    • Setup & Options object
    • 🧠 Build a website dashboard, monetize your bot, and get more users
    • 💰 $100 in FREE Hosting Credits
    • 🙋‍♂️ Support Server
    • 📺 YouTube Channel
  • Commands
    • Ping pong command example
    • Command properties
    • Correct argument usage
    • Command initialization method
    • Bot owner only commands
    • Test servers
    • Cooldowns
    • Required permissions
    • Slash commands
    • Inferred slash command arguments
    • Custom slash command arguments
    • Autocomplete
  • Command Validations
    • Validation setup
    • Runtime validations
    • Syntax validations
  • Event Handler
    • Event Handling
    • Dynamic Validations
  • Features
    • Features
  • Built-in commands and features
    • Enabling and disabling commands
    • Configurable required roles
    • Configurable required permissions
    • Per-guild prefixes
    • Customizable channel specific commands
    • Custom commands
Powered by GitBook
On this page

Was this helpful?

  1. Command Validations

Runtime validations

PreviousValidation setupNextSyntax validations

Last updated 1 year ago

Was this helpful?

You can provide your own runtime validations methods that will return a boolean for if the command should actually be ran or not.

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");
};