title: Add member counter to bot activity discord.js
body: <p>I tried to do that but it isn't working. How can I resolve this?</p>
  <pre><code>const Discord = require('discord.js');
  const client = new Discord.Client();
  client.on('ready', () =&gt; {
    console.log(`Logged in as ${client.user.tag}!`);
    client.user.setActivity(`[${member.guild.memberCount}] Players`, {type: &quot;PLAYING&quot;});
  });
  client.on(&quot;guildMemberAdd&quot;, member =&gt; {
      client.user.setActivity(`[${member.guild.memberCount}] Players`, {type: &quot;PLAYING&quot;});
  });
  client.on(&quot;guildMemberRemove&quot;, member =&gt; {
      client.user.setActivity(`[${member.guild.memberCount}] Players`, {type: &quot;PLAYING&quot;});
  });
  </code></pre>