title: Discord.JS Command Handler not working or updating
body: <p>I am trying to add a command handler to my bot, however, only one command is working and no matter how I change the command, it does not update. Here is my code.</p>
  <p>This is at the top underneath the packages and above the on ready code.</p>
  <pre><code>fs.readdir('./commands/', (_err, files) =&gt; {
   files.forEach((file) =&gt; {
    if (!file.endsWith('.js')) return;
     bot.commands = new Discord.Collection()
    let command = require(`./commands/${file}`); // access all details though this variable
    bot.commands.set(command.name, command);
    console.log(` Command loaded: ${command.name}`);
   });
  });
  </code></pre>
  <p>This is in the resources command</p>
  <pre><code>const Discord = require(&quot;discord.js&quot;)
  const fs = require(&quot;fs&quot;)
  
  module.exports = {
   name: 'resources',
   // any other details you might like, such as:
   description: 'Shows resources',
   execute(bot, message, args, prefix) {
    // the actual function
      let resourceText = fs.readFileSync('txtfiles/resources.txt', 'utf8')
      message.suppressEmbeds(true)
      message.channel.send(resourceText)
      
   }
   }
  </code></pre>
  <p>The resources command works just fine, but the ship command does not.</p>
  <pre><code>const Discord = require(&quot;discord.js&quot;)
  const fs = require(&quot;fs&quot;)
  
  module.exports = {
   name: 'ship',
   // any other details you might like, such as:
   description: 'ships people',
   execute(bot, message, args, prefix) {
    // the actual function
      message.channel.send(&quot;please work&quot;)
      
   }
   }
  </code></pre>
  <p>And this is in the &quot;on messageCreate&quot; thing</p>
  <pre><code>if(cmd===`${prefix}resources`){bot.commands.get('resources').execute(bot, message, args, prefix);}
  
  if(cmd===`${prefix}ship`){bot.commands.get('ship').execute(bot, message, args, prefix);}
  </code></pre>
  <p>I have tried putting these underneath the packages</p>
  <pre><code>delete require.cache['./index.js'];
  delete require.cache[require.resolve('./index.js')]
  </code></pre>
  <p>However, I am getting this error message
  <code>Unhandled promise rejection: TypeError: Cannot read properties of undefined (reading 'execute')</code></p>
  <p>The resources command works just fine, even if we delete all the code in the file, and the ship command does not work at all.</p>