initial commit

This commit is contained in:
2024-04-26 16:33:00 +02:00
commit 929d8abc87
7 changed files with 94 additions and 0 deletions

18
loaders/loadCommands.js Normal file
View 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`);
}