initial commit
This commit is contained in:
18
loaders/loadCommands.js
Normal file
18
loaders/loadCommands.js
Normal file
@ -0,0 +1,18 @@
|
||||
const { readdirSync } = require("fs");
|
||||
|
||||
module.exports = client => {
|
||||
|
||||
let count = 0;
|
||||
const dirsCommands = readdirSync("./commands/");
|
||||
|
||||
for(const dirs of dirsCommands) {
|
||||
const filesDirs = readdirSync(`./commands/${dirs}/`).filter(f => f.endsWith(".js"));
|
||||
for(const files of filesDirs) {
|
||||
const command = require(`../commands/${dirs}/${files}`);
|
||||
client.commands.set(command.name, command);
|
||||
count ++;
|
||||
};
|
||||
};
|
||||
|
||||
console.log(`[Commands] => ${count} logged commands`);
|
||||
}
|
Reference in New Issue
Block a user