title: How do I retrieve old messages from a channel?
body: <p>I have a bot that should allow me to read all the messages from a selected server and channel when I request it. I've tried using <code>channel.messages.cache.array()</code>, but that just returns <code>[]</code>. How do I effectively retrieve all (or most) of the messages from a Channel? Also, I'm using Discord.js v12.3.1.</p>
  <pre class="lang-js prettyprint-override"><code>// logging in the bot
  var data = {};
  client.on('guildCreate', function (guild) {
      var channel = guild.systemChannel;
      var msgs = channel.messages.cache.array();
      console.log(msgs);
  });
  </code></pre>