title: Discord - BOT sending a private message
body: <p>Issue sending a private message in Discord. Following are two samples of code (simplified). </p>
  
  <pre><code>@client.event
  async def on_message(message):
  </code></pre>
  
  <p>this code block sends back the message (cookie emoji) to the user regardless if its a private chat (with the bot) or channel</p>
  
  <pre><code>    if message.content == ".cookie":
          await client.delete_message(message)
          await client.send_message(message.channel, ":cookie:")
  </code></pre>
  
  <p>this block of code sends a message to the user privately given that the user sent a command in the channel, it works, im happy with this. </p>
  
  <pre><code>    if message.content == ".cookie":
          await client.delete_message(message)
          await client.send_message(message.author, ":cookie:")
  </code></pre>
  
  <p>the issue is, I would like the user to be able to send a message ".cookie" in the channel or in the private message to the bot and get the a private message (cookie emoji) back. </p>
  
  <p>with the last block of code. if I send a command .cookie to the channel, I get a private message from the bot. If I send a command .cookie to the Bot privately, I get an error. </p>
  
  <p>not sure how to handle this, thank you </p>