title: Checking if a message is a DM. (Discord.js and discord.js-commando)
body: <p>How can I check if a message is a DM in Discord.js? I have tried several ways on how to test against this, I have tried these methods:</p>
  <pre><code>if (msg.channel.isDM) ... Produced undefined
  if (msg.isDM) ... Produced undefined
  if (msg.channel.DMChannel.isDM) ... produced undefined
  if (msg.DMChannel) ... produced undefined
  if (msg.channel.DMChannel.dm) ... produced undefined
  if (msg.channel.dm) ... produced undefined
  </code></pre>
  <p>I have tried everything after producing <code>msg</code> in a console, and trying to decipher where the heck I do this at. Even the documentation isn't very clear on WHERE to check for this at. I have looked at multiple &quot;solutions&quot; who just spout <code>&lt;message&gt;.channel.dm</code>. Well... that doesn't work.</p>
  <p>EDIT:
  So it does seem it is <code>&lt;message&gt;.isDM</code>. However, in my commands this does not work. I can find <code>isDM</code> in the array and when I <code>console.log(msg)</code> it produced <code>true</code> which is expected. However, doing <code>console.log(msg.isDM)</code> is printing out <code>undefined</code>. It seems weird because it obviously is defined.</p>