title: Logging messages from one channel
body: <p>I've tried several times to work this and I don't understand the error, I am receiving but I'll explain what I'm trying to do: Basically I want to log the messages from one channel and paste those messages onto a different channel. Here is the code I have so far;</p>
  <pre><code>client.on(`message`, message =&gt; {
      if (message.author.bot) return; // If the message is by a bot return.
      if (!message.guild) return; // If the message isn't in a guild return.
      if (message.guild) {
          const msgLog = `[MESSAGE] [${message.guild.name}] [#${message.channel.name}] ${message.author.username}#${message.author.discriminator}: ${message.content}\n` // You can change this to whatever you want.
          client.channels.get(`814685640088223795`).send(msgLog); // Replace CHANNEL ID with the channel ID you want the logs to go to.
          return;
      }
  })
  </code></pre>
  <p>The error I am receiving goes as follows:</p>
  <pre><code>(node:17260) UnhandledPromiseRejectionWarning: ReferenceError: client is not defined
      at Object.&lt;anonymous&gt; (D:\stuff\S1 Discord Bot\s1-bot\src\events\message\message.js:1:1)
      at Module._compile (internal/modules/cjs/loader.js:1063:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
      at Module.load (internal/modules/cjs/loader.js:928:32)
      at Function.Module._load (internal/modules/cjs/loader.js:769:14)
      at Module.require (internal/modules/cjs/loader.js:952:19)
      at require (internal/modules/cjs/helpers.js:88:18)
      at registerEvents (D:\stuff\S1 Discord Bot\s1-bot\src\utils\registry.js:33:21)
  (Use `node --trace-warnings ...` to show where the warning was created)
  (node:17260) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
  (node:17260) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>
  <p>Thanks</p>