const fs = require("fs"); module.exports = (client) => { client.prefixCommands = new Map(); client.handlePrefixes = async () => { const commandFolder = fs.readdirSync("./src/commands/prefix-commands/"); for (const folder of commandFolder) { const commandFiles = fs .readdirSync(`./src/commands/prefix-commands/${folder}/`) .filter((file) => file.endsWith(".js")); for (const file of commandFiles) { const command = require(`../../commands/prefix-commands/${folder}/${file}`); client.prefixCommands.set(command.data.name, command); } } }; };