title: Trying to send a message to multiple discord servers
body: <p>Heres my code. I'm trying to send a message to multiple servers when a user types a command !sendall. For example, when the user types !sendall Hello, it will send "Hello" to multiple discord servers. Thanks for the help!</p>
  
  <p>When doing this, I get this error</p>
  
  <pre><code>(node:14424) UnhandledPromiseRejectionWarning: ReferenceError: guild is not defined
      at Client.&lt;anonymous&gt; (C:\Users\16034\Desktop\Bot Monitors\bot.js:52:56)
      at Client.emit (events.js:310:20)
      at MessageCreateAction.handle (C:\Users\16034\Desktop\Bot Monitors\node_modules\discord.js\src\client\actions\MessageC
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>// Main
  const Discord = require("discord.js");
  const client = new Discord.Client();
  const config = require("./config.json");
  
  var guildList = ["707366229446492208", "704552256007307364"];
  
  // Bootup
  client.on("ready", () =&gt; {
    console.log(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`); 
    client.user.setActivity(`Serving ${client.guilds.size} servers`);
  });
  
  // Guild Logs
  client.on("guildCreate", guild =&gt; {
    console.log(`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
    client.user.setActivity(`Serving ${client.guilds.size} servers`);
  });
  client.on("guildDelete", guild =&gt; {
    console.log(`I have been removed from: ${guild.name} (id: ${guild.id})`);
    client.user.setActivity(`Serving ${client.guilds.size} servers`);
  });
  
  // Required
  client.on("message", async message =&gt; {
    if(message.author.bot) return;
    if(message.content.indexOf(config.prefix) !== 0) return;
    const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();
  
    // Sendall
    if(command === "sendall") 
          try {
              guildList.forEach(guild =&gt; guild.defaultChannel.send("messageToSend"));
          } catch (err) {
              console.log("Could not send message to " + guild.name);
          }
  });
  client.login(config.token);
  </code></pre>