UNPKG

xopbot

Version:

XOPBOT Is A Multipurpose Bot With Over 200+ Commands That Make You Love The Bot!

19 lines (15 loc) 580 B
const fs = require('fs'); module.exports = (client, Discord) => { const command_folders = fs.readdirSync("./commands") for (const folder of command_folders) { const command_files = fs.readdirSync(`./commands/${folder}`).filter(file => file.endsWith('.js')); for (const file of command_files) { const command = require(`../commands/${folder}/${file}`); if (command.name) { client.commands.set(command.name, command); } else { continue; } } } }