删除作者命令执行discord.py

Remove authors command execution discord.py

我希望我的机器人在命令执行后删除作者的消息。我尝试了各种变体,但无法弄清楚。 这是代码:

   async def kronellermynt(ctx):
     kronellermyntlist = ["Kron", "Mynt"]
     responseone = random.choice(kronellermyntlist)
     await ctx.send(responseone)
     await ctx.message.delete()

这可行:

import random

@bot.command()
async def kronellermynt(ctx):
     await ctx.message.delete()
     list = ["Kron", "Mynt"]
     await ctx.send(random.choice(list))

还要检查终端是否有错误(如果机器人没有得到 manage_messages 许可)