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

Required permissions

PreviousCooldownsNextSlash commands

Last updated 1 year ago

Was this helpful?

You may want your commands to only be ran by users who have specific Discord permissions. This is often useful for administration commands.

Using WOKCommands you can easily specify what Discord permissions users need to run the command:

ping.js
const { PermissionFlagsBits } = require("discord.js");
const { CommandType } = require("wokcommands");

module.exports = {
  description: "Ping pong command",

  type: CommandType.BOTH,

  permissions: [PermissionFlagsBits.Administrator],

  callback: () => {
    return {
      content: "Pong!",
    };
  },
};
ping.ts
import { PermissionFlagsBits } from "discord.js";
import { CommandObject, CommandType, CooldownTypes } from "wokcommands";

export default {
  description: "Ping pong command",

  type: CommandType.BOTH,

  permissions: [PermissionFlagsBits.Administrator],

  callback: () => {
    return {
      content: "Pong!",
    };
  },
} as CommandObject;