So I am making a discord bot, and I want to run commands in different files. in my index I have
Fs.readdir("./commands/", (_err, files) => {
files.forEach((file) => {
if (!file.endsWith(".js")) return;
let props = require(`./commands/${file}`);
let commandName = file.split(".")[0];
client.commands.set(commandName, props);
console.log(`👌 Command loaded: ${commandName}`);
});
});
And In my /commands/help.js I have
const Discord = require('discord.js');
exports.run = async (client, message, args, prefix) => {
if (args[0] == 'hi') {
message.channel.send
}
}
and it doesent do anything. In my console it says
� Command loaded: help
I dont know what I am doing wrong. Can you help?
command.execute()ing the command?!help hifor it to do anythingmessage.js(message event)?