require("dotenv").config(); const { token } = process.env; const { Client, Collection, GatewayIntentBits } = require("discord.js"); const fs = require('fs'); const client = new Client({ intents: GatewayIntentBits.Guilds }); client.commands = new Collection(); client.commandArray = []; const FunctionFolders = fs.readdirSync("./src/functions"); for (const folder of FunctionFolders) { const FunctionFiles = fs .readdirSync("./src/functions/${folder}") .filter(file => file.endsWith(".js")); for (const file of FunctionFiles) require("/functions/${folder}/${file}")(client); } client.handleEvents(); client.handleCommands(); client.login(token);