AnIdiotsGuide/discordjs-bot-guide

Commands are not running in command handler

SudhanPlayz opened this issue · 1 comments

in main file

client.commands = new Enmap();

fs.readdir("./commands/", (err, files) => {
  if (err) return console.error(err);
  files.forEach(file => {
    if (!file.endsWith(".js")) return;
    let props = require(`./commands/${file}`);
    let commandName = file.split(".")[0];
    console.log(`Attempting to load command ${commandName}`);
    client.commands.set(commandName, props);
  });
});

in commands/help.js

module.exports = (client, discord, message) => { 
  let embed = new discord.RichEmbed()
  .setTitle("Commands of "+ client.user.username)
  .setColor("BLUE")
  message.channel.send(embed)
}

Help me

You might have better luck asking in the discord server https://discord.gg/4NE4bk7