title: Python Discord bot delete users message
body: <p>I am working on a discord bot in python3 (discord.py 1.3.3, discord 1.0.1) and I have a need to delete a user message, but I can't figure out how to call the coroutine properly. </p>
  
  <p>I have looked at <a href="https://stackoverflow.com/questions/42182243/deleting-user-messages-in-discord-py">some</a> <a href="https://stackoverflow.com/questions/52348148/delete-messages-with-python-discord-bot">other</a> <a href="https://stackoverflow.com/questions/45597094/how-to-delete-a-specific-message-by-id-using-discord-py?rq=1">threads</a>, and tried reviewing the <a href="https://discord.com/developers/docs/resources/channel#get-channel-message" rel="nofollow noreferrer">documentation</a> (and the <a href="https://discordpy.readthedocs.io/en/latest/api.html#discord.Message.delete" rel="nofollow noreferrer">discord.py docs</a>) but I haven't been able to figure it out.</p>
  
  <p>Here's what I'm testing with:</p>
  
  <pre><code>import discord
  from discord.ext import commands
  
  TOKEN = os.getenv('DISCORD_TOKEN')
  bot = commands.Bot(command_prefix='!')
  
  @bot.command(name='deleteme', help='testing command for dev use')
  async def deleteme(ctx):
      msg = ctx.message.id
      print(f'DEBUG: message id is {msg}')
      await msg.delete
      # await ctx.delete(msg, delay=None)  #nope
      # await ctx.delete_message(ctx.message)  #nope
      # await bot.delete_message(ctx.message)  #nope
      # await command.delete_message(ctx.message)  #nope
      # await discord.Client.delete_message(msg)  #nope
  </code></pre>
  
  <p>Running this returns the console debug message with an ID number, but the message isn't deleted. If I add a debug print line after <code>await msg.delete</code> it doesn't return. So this tells me where the script is hanging. That said, I still haven't been able to figure out what the proper command should be.</p>
  
  <p>The bots server permissions include "manage messages"</p>