Dynamic Command Handling
Get started with our easy-to-use command handler
Starting Up
First, create a folder called "cmds". This will be your commands folder. Then, make a subfolder for each command module. For example, misc, music, economy. In each folder make a module.js file.
module.exports = {
key: "misc", // Module Key (LOWERCASE!)
name: "Miscelaneous", // Module Name
desc: "Misc commands" // Module Description
}For each command, make a file in the folder. for example, ping.js
module.exports = {
name: "ping", // Command Name
module: "misc", // Must be a valid key to a module.
execute: (client, message, args) => {
// Your code here
message.channel.send(`Pong! ${client.ws.ping}ms`)
}
}So on so forward.
Incorporating it to our code
Last updated
Was this helpful?