title: discord.js TypeError: Cannot read property 'name' of undefined
body: <pre><code>const botconfig = require("./botconfig.json");
  const tokenfile = require("./token.json");
  const Discord = require("discord.js");
  const fs = require("fs");
  const bot = new Discord.Client({disableEveryone: true});
  bot.commands = new Discord.Collection();
  
  fs.readdir("./commands/", (err, files) =&gt; {
  
    if(err) console.log(err);
  
    let jsfile = files.filter(f =&gt; f.split(".").pop() === "js")
    if(jsfile.length &lt;= 0){
      console.log("Couldn't find commands.");
      return;
    }
  
    jsfile.forEach((f, i) =&gt;{
      let props = require(`./commands/${f}`);
      console.log(`${f} loaded!`);
      bot.commands.set(props.help.name, props);
    });
  
  });
  
  
  bot.on("ready", async () =&gt; {
    console.log(`${bot.user.username} is online on ${bot.guilds.size} servers!`);
  
    bot.user.setActivity("!help | website.xyz", {type: "WATCHING"});
  
    //bot.user.setGame("on SourceCade!");
  });
  
  bot.on("message", async message =&gt; {
    if(message.author.bot) return;
    if(message.channel.type === "dm") return;
  
    let prefix = botconfig.prefix;
    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);
  
    let commandfile = bot.commands.get(cmd.slice(prefix.length));
    if(commandfile) commandfile.run(bot,message,args);
  
  });
  
  bot.login(tokenfile.token);
  </code></pre>
  
  <p>This is my index folder, when I try to run the bot I get this error. I've tried everything but I'm not the best at this as I am still learning so any help would be greatly appreciated! Thanks </p>
  
  <pre><code>C:\Users\Luca\Desktop\DiscordJS\RedHQ-Bot\index.js:21
      bot.commands.set(props.help.name, props);
                                  ^
  
  TypeError: Cannot read property 'name' of undefined
      at jsfile.forEach (C:\Users\Luca\Desktop\DiscordJS\RedHQ-Bot\index.js:21:33)
      at Array.forEach (&lt;anonymous&gt;)
      at fs.readdir (C:\Users\Luca\Desktop\DiscordJS\RedHQ-Bot\index.js:18:10)
      at FSReqWrap.oncomplete (fs.js:135:15)
  [nodemon] app crashed - waiting for file changes before starting...
  </code></pre>