title: Cannot read properties of undefined (reading 'members')
body: <p>I've been searching all kinds of answers for this kind of error but everything I try is either an error or it doesn't work.
  Basically I'm trying to make a bot for my Discord server and have a presence status saying how many members are in my server. I get this error every time:
  <code>name: `${guild.members.filter(member =&gt; !member.user.bot).size} users!` ^ TypeError: Cannot read properties of undefined (reading 'members')</code>
  I already checked that the guild ID is correct, that I have no grammar errors and everything.</p>
  <p>Here's the code:</p>
  <pre class="lang-js prettyprint-override"><code>const guild = client.guilds.cache.get(&quot;745807908071145564&quot;);
  client.once(&quot;ready&quot;, () =&gt; {
    console.log(&quot;Bot is ready!&quot;);
    setInterval(() =&gt; {
      client.setPresence({
        status: &quot;online&quot;, 
        activity: {
          name: `${guild.members.filter(member =&gt; !member.user.bot).size} users!`, 
          type: &quot;WATCHING&quot;
        }
      })
      .catch(console.error);
    },5000); // 5 seconds just for testing
  });
  </code></pre>