mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
19 lines
557 B
JavaScript
19 lines
557 B
JavaScript
const { readdirSync } = require("fs");
|
|
|
|
|
|
module.exports = async 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.data.name, command);
|
|
count++;
|
|
}
|
|
};
|
|
|
|
console.log(`[Commands Slash] => ${count} logged commands`);
|
|
}
|