title: How to a send message in a channel when the bot is ready?
body: <p>I was trying to modify the "ping pong" sample code in discord.js.<br>
  Instead of logging in the console, I wanted to send a message in a specific channel in Discord.
  I have tried using the code below to do it but it keeps showing me this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>(node:10192) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channels' of undefined
      at Client.&lt;anonymous&gt; (D:\GAMES\DiscordBot\index.js:7:12)
  </code></pre>
  
  <p>This is the code I'm using:</p>
  
  <pre class="lang-js prettyprint-override"><code>const Discord = require('discord.js');
  const client = new Discord.Client();
  
  console.log(client);
  
  client.on('ready', client =&gt; {
    client.channels.get('787667808777998851').send('Hello here!');
  });
  
  client.on('message', msg =&gt; {
    if (msg.content === 'ping') {
      msg.reply('pong');
    }
  });
  
  client.login('auth-token');
  </code></pre>