fs.readdir("./commands/", (_err, folders) => { folders.forEach((dir) => { fs.readdir(`./commands/${dir}/`,(_err, files) => { files.forEach(file => if (!file.endsWith(".js")) return; let props = require(`./commands/${file}`); let commandName = file.split(".")[0]; client.commands.set(commandName, { name: commandName, ...props }); console.log(`[Command] ✅ Loaded: ${commandName}`); } } });