title: JavaScript,Discord.js, Node.js TypeError: Cannot read property 'execute' of undefined
body: <p>I'm building a discord bot and I want to save information in bdays.json but this error pops up. All other commands are working just fine but I am getting this error:</p>
  <p>TypeError: Cannot read property 'execute' of undefined</p>
  <p>What should I do?</p>
  <p>main.js</p>
  <pre><code>const Discord = require('discord.js');
  
  const client = new Discord.Client();
  
  const prefix = '?';
  
  const fs = require('fs');
  
  client.commands = new Discord.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.name, command);
  }
  
  client.once('ready', () =&gt; {
      console.log('Bot is online!');
  });
  
  client.on('message', message =&gt; {
      if (!message.content.startsWith(prefix) || message.author.bot) return;
  
      const args = message.content.slice(prefix.length).split(/ +/);
      const command = args.shift().toLowerCase();
  
      if (command === 'jsidement') {
          client.commands.get('ping').execute(message, args);
      } else if (command === 'help') {
          client.commands.get('help').execute(message, args, Discord);
      } else if (command === 'mute') {
          client.commands.get('mute').execute(message, args);
      } else if (command === 'unmute') {
          client.commands.get('unmute').execute(message, args);
      } else if (command === 'remember') {
          client.commands.get('remember').execute(message, args);
      }
  })
  
  client.login('Token');
  </code></pre>
  <p>and remeber.js</p>
  <pre><code>module.exports = {
      name: 'remeber',
      description: 'this is a remember command!',
      execute(message, args){
          const fs = require('fs');
          client.bdays = require ('./bdays.json');
          
          client.bdays [message.author.username] = {
              message: message.content
          }
          fs.writeFile('./bdays.json', JSON.stringify (client.bdays, null, 4), err =&gt; {
              if(err) throw err;
              message.channel.send('Saved!');
          });
      }
  }
  </code></pre>
  <p>What should I do?</p>