title: How to receive DMs and log them to a text file?
body: <p>I managed to get my bot to send DMs to people by providing their ID and a message I want to send. The problem is that people respond to the bot and I would like to receive the messages to my console window (where at the same time exceptions/errors are being listed). I tried using following code but it returned that it does not have an attribute 'message':</p>
  
  <pre><code>@client.event(pass_context=True)
  async def on_message(ctx):
      print(f"{ctx.author} said: {ctx.message}")
      await ctx.send(f"Hi, I'm an automated message. I cannot receive any information on your message. All I might get is: {ctx}")
      log = open("commands/info/logging/logmsg.txt", "a")
      log.writelines(f"{ctx.author} has sent: {ctx.message}")
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>Ignoring exception in on_message
  Traceback (most recent call last):
    File "C:\Users\MODERATED\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 312, in _run_event
      await coro(*args, **kwargs)
    File "showmessages.py", line 18, in on_message
      print(f"{ctx.author} said: {ctx.message}")
  AttributeError: 'Message' object has no attribute 'message'
  </code></pre>