title: guild.members.forEach is not a function
body: <p>I'm working on a bot that sends direct message to everyone on the server.
  Here's my code that generates errors. Can someone help me?</p>
  
  <p>Here's the error: "TypeError: guild.members.forEach is not a function"</p>
  
  <pre class="lang-js prettyprint-override"><code>client.on("message", msg =&gt; {
   if (msg.guild &amp;&amp; msg.content.startsWith("$private")) {
     let text = msg.content.slice("$private".length); // cuts off the /private part
     let guild = msg.guild
     guild.members.forEach(member =&gt; console.log(member.user.username)); ```
  </code></pre>