title: TypeError: Cannot read properties of undefined (reading 'commands')
body: <p>This is the part of the main file that I think is causing the issue</p>
  <pre><code>client.commands = new Collection();
  const commandFiles = fs.readdirSync('./commands').filter(file =&gt; file.endsWith('.js'));
  
  for (const file of commandFiles) {
      const command = require(`./commands/${file}`);
      client.commands.set(command.data.name, command);
  }
  
  const eventFiles = fs.readdirSync('./events').filter(file =&gt; file.endsWith('.js'));
  
  for (const file of eventFiles) {
      const event = require(`./events/${file}`);
      if (event.once) {
          client.once(event.name, (...args) =&gt; event.execute(...args));
      } else {
          client.on(event.name, (...args) =&gt; event.execute(...args));
      }
  }
  </code></pre>
  <p>This is the code in the Interaction Create script where the error is coming from</p>
  <pre><code>        if (!interaction.isCommand()) return;
  
          const command = client.commands.get(interaction.commandName);
  
          if (!command) return;
  
          try {
              await command.execute(interaction);
          } catch (error) {
              console.error(error);
              await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
          }
      },
  };
  </code></pre>
  <p>Forgot to mention the error is on the line defining 'command' in the interaction create script</p>
  <p>FULL ERROR:</p>
  <pre><code>const command = client.commands.get(interaction.commandName);
                         ^
  
  TypeError: Cannot read properties of undefined (reading 'commands')
      at Object.execute (C:\Users\willi\OneDrive\Desktop\New Bot\events\interactionCreate.js:6:26)
      at Client.emit (node:events:390:28)
      at InteractionCreateAction.handle (C:\Users\willi\OneDrive\Desktop\New Bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:70:12)
  :4:36)
      at WebSocketManager.handlePacket (C:\Users\willi\OneDrive\Desktop\New Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:350:31)
      at WebSocketShard.onPacket (C:\Users\willi\OneDrive\Desktop\New Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)
      at WebSocketShard.onMessage (C:\Users\willi\OneDrive\Desktop\New Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
      at WebSocket.onMessage (C:\Users\willi\OneDrive\Desktop\New Bot\node_modules\ws\lib\event-target.js:199:18)
      at WebSocket.emit (node:events:390:28)
  </code></pre>