title: TypeError: Cannot read property 'guild' of undefined Discord.js
body: <p>I'm currently in problem with Discord.js, it's saying: Cannot read property 'guild' of undefined.</p>
  <p>msg.guild.id
  ^</p>
  <p>It's just sending that error, code:</p>
  <pre><code>client.on('message', (message, msg) =&gt; {
      if(db.get(`${msg.guild.id}_prefix`)) {
        var prefix = defaultPrefix;
      } else { 
          var prefix = db.get(`${msg.guild.id}_prefix`); 
      }
      if(msg.content.startsWith(prefix + `ping`)) {
          msg.channel.send(`Fetching Latency...`).then((m) =&gt; {
          const ping = new Discord.MessageEmbed()
          .setTitle(`Pong! `)
          .addFields( { name: `API Latency`, value: `${client.ws.ping}ms` },
                      { name: `Bot Latency`, value: `${msg.createdTimestamp - m.createdTimestamp}ms` } )
              m.delete()
             msg.channel.send(ping)
      })}
  }); 
  </code></pre>
  <p><strong>Please help me if you could</strong></p>