title: Cannot read properties of undefined (reading 'execute)
body: <p>On my discord bot, I am making a &quot;nickname&quot; command.
  My code on the nickname.js:</p>
  <pre class="lang-js prettyprint-override"><code>const Discord = require(&quot;discord.js&quot;);
  const client = new Discord.Client({ intents: [&quot;GUILDS&quot;, &quot;GUILD_MESSAGES&quot;] });
  module.exports = {
      name: 'nick',
      description: 'This command with change a users nickname.',
      execute(message, args){
          const memberToEdit = message.mentions.members.first();
          const newNickname = message.content.replace(`${prefix}changenick`, '').split(' ').pop().trim();
          memberToEdit.setNickname(newNickname);
          }
  }
  </code></pre>
  <p>The error I get whilst trying to run the command:</p>
  <pre class="lang-none prettyprint-override"><code>TypeError: Cannot read properties of undefined (reading 'execute')
      at Client.&lt;anonymous&gt; (C:\Users\Admin\Desktop\DiscordBot\main.js:79:36)
      at Client.emit (node:events:520:28)
      at MessageCreateAction.handle (C:\Users\Admin\Desktop\DiscordBot\node_modules\discord.js\src\client\actions\MessageCreate.js:26:14)
      at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Admin\Desktop\DiscordBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
      at WebSocketManager.handlePacket (C:\Users\Admin\Desktop\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31)
      at WebSocketShard.onPacket (C:\Users\Admin\Desktop\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
      at WebSocketShard.onMessage (C:\Users\Admin\Desktop\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
      at WebSocket.onMessage (C:\Users\Admin\Desktop\DiscordBot\node_modules\ws\lib\event-target.js:199:18)
      at WebSocket.emit (node:events:520:28)
      at Receiver.receiverOnMessage (C:\Users\Admin\Desktop\DiscordBot\node_modules\ws\lib\websocket.js:1137:20)
  
  Node.js v17.4.0
  </code></pre>
  <p>My main.js file is the same as the rest of the commands which work fine...</p>
  <pre class="lang-js prettyprint-override"><code>  if(command === 'nick'){
      client.commands.get('nickname').execute(message, args)
    }
  </code></pre>
  <p>I can't seem to understand why this command specifically just wont work.</p>