Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 1.95 KB

Command Syntax.md

File metadata and controls

78 lines (65 loc) · 1.95 KB

@File [Command Syntax and Explanation]; @Author [Gamemaster9]; @Version [V0.0.1]

Here is the syntax for creating command files :-

const D = require(`discord.js`);
const colors = require(`colors`);

module.exports = {
  name: "",
  description: "",
  type: "",
  options: [],
  ooner: false,
  permissions: ["", ""],
  roles: ["", ""],
  cooldown: 5,

  run: async (Bot, interaction) => {
  },
};

Explanation is here!

BASICS :

// Having our required dependencies.
const D = require(`discord.js`);
const colors = require(`colors`);

// Exporting all the needed stuffs.
module.exports = {
  
  // Name of the command.(Required)
  name: "",
  // Description of the command. (Required)
  description: "",

For extra options and settings :

  // For type of command. i.e. "CHAT_INPUT" = 1, "USER" = 2, "MESSAGE" = 3. Default is 1.
  type: "",
  // Adding some extra options for commands. (Optional)
  options: [
  
    {
      type: "", // Type of the option.
      name: "", // Option's name.
      description: "", // Option's description
      required: false, // If it is mandatory option or not. Default is "false".
    },
  
  ],
  
  // If the command is owner only command or not. Default is "false". (Optional)
  ooner: false,
  // If the user requires any extra permission to execute the command, to make admin commands, etc. (Optional)
  permissions: ["", ""],
  // If the user requires any specific role to use the command. (Optional)
  roles: ["", ""],
  // Cooldown for the command (in seconds). Default is 5 seconds. (Optional)
  cooldown: 5,

Final thing is to set the response!

  // Running our command using `run: async() => {}` (Required)
  run: async (Bot, interaction) => {
      // Do some stuff once the command is run...
  },
};

Note: Add all the extra options and response in module.exports = {...} itself.

For Any kind of futher Info/ Help, you can contact TheseGamemaster9#8566 through DMs.