So when I was coding a Discord bot, it suddenly just started saying stuff wasn't a function. And this applies to everything, it really just applies to anything and if I try to call a function then it says it's not a function. For example:
For example this line of code I have here:
client.commandHandler(commandFolders, "./src/commands")
It says it's not a function, but I've defined it as a function:
module.exports = (client) => {
client.commandHandler = async (commandFolders, path) => {
const cmds = [];
for (const folder of commandFolders) {
const commandFiles = fs.readdirSync(`${path}/${folder}`).filter(f => f.endsWith('.js'));
for (const f of commandFiles) {
const command = require(`${path}/${folder}/${f}`)
cmds.push(command.data.toJSON());
}
}
}
}
Anyone know why?