title: How do I send a message to a specific discord server using the server id?
body: <p>I am trying to make a discord bot send a message to a specific discord server using the server's id, I do not know the command for it, I tried something like this but it didn't work, thanks in advance! 
  P.S I know the server and channel ids.</p>
  
  <p>edit: updated the code as far as I got, now I get a error.</p>
  
  <pre><code>const Discord = require('discord.js');
  const bot = new Discord.Client();
  
  
  module.exports = {
      name: "inviteme",
      description: "inviteme",
      execute(message, args){
          var server = bot.guilds.get("642388927499730975");
          var channel = server.channels.get("642389069829111809");
          bot.guilds.forEach(guild =&gt; {
              guild.channels.first().createInvite()
                  .then(inv =&gt; message(channel).send(`${guild.name} | ${inv.url}`));
          });
      }
  }
  </code></pre>
  
  <p>The error I get is this:</p>
  
  <pre><code>TypeError: Cannot read property 'channels' of undefined
      at Object.execute (d:\etc\Discord Bots\Coinflip\commands\inviteme.js:10:30)
      at Client.&lt;anonymous&gt; (d:\etc\Discord Bots\Coinflip\index.js:31:42)
      at Client.emit (events.js:210:5)
      at MessageCreateHandler.handle (d:\etc\Discord Bots\Coinflip\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
      at WebSocketPacketManager.handle (d:\etc\Discord Bots\Coinflip\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
      at WebSocketConnection.onPacket (d:\etc\Discord Bots\Coinflip\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
      at WebSocketConnection.onMessage (d:\etc\Discord Bots\Coinflip\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
      at WebSocket.onMessage (d:\etc\Discord Bots\Coinflip\node_modules\ws\lib\event-target.js:120:16)
      at WebSocket.emit (events.js:210:5)
      at Receiver.receiverOnMessage (d:\etc\Discord Bots\Coinflip\node_modules\ws\lib\websocket.js:789:20)
  </code></pre>
  
  <p>Please help, thank you in advance.</p>