title: Discord bot TypeError: client.guilds.forEach is not a function
body: <p>I am trying to make my discord bot to print all the servers that it's connected to but when I try to run my code I get this type error: 
  <code>TypeError: client.guilds.forEach is not a function</code></p>
  
  <pre><code>const Discord = require("discord.js")
  const client = new Discord.Client()
  
  client.on("ready", () =&gt; {
      console.log("Conectat ca si: " + client.user.tag)
  
      client.user.setActivity("my brother kiko jr", {type: "WATCHING"})
  
      client.guilds.forEach((guild) =&gt; {
          console.log(guild.name)
  
      })
  
  })
  
  client.login("xyz")
  </code></pre>