title: Discord.js. CronJob not working with command handling
body: <p>As said in the title I have a problem when i need to export a schedule made with CronJob. The error I get is:</p>
  <p><code>TypeError: Cannot read property 'send' of undefined</code></p>
  <p>Inside of <code>Cron.js</code> I have:</p>
  <pre class="lang-js prettyprint-override"><code>const Discord = require('discord.js');
  const fs = require(&quot;fs&quot;);
  const client = new Discord.Client();
  const { prefix, token } = require(&quot;../config.json&quot;);
  
  const cron = require(&quot;cron&quot;)
  
  const test = new cron.CronJob(&quot;00 00 13 * * 5&quot;, () =&gt;{
      client.channels.fetch(&quot;768752722743918614&quot;)
      let testmsg = client.channels.cache.get(&quot;768752722743918614&quot;)
      testmsg.send(&quot;test&quot;)
  })
  module.exports = test
  </code></pre>
  <p>Inside of <code>bot.js</code>:</p>
  <pre><code>const Discord = require('discord.js');
  const fs = require(&quot;fs&quot;);
  const client = new Discord.Client();
  const { prefix, token } = require(&quot;../config.json&quot;);
  
  const cron = require(&quot;cron&quot;)
  const test = require(&quot;./commands/autocode&quot;)
  
  test.start()
  </code></pre>
  <p>That schedule works without problems inside <code>bot.js</code>, but I don't want to make it untidy.</p>