[我已经尝试过此discord.py delete author message after executing command,并且现在搜索了一个多小时,并且在运行后我找不到删除执行者消息的解决方案。
代码:
from discord.ext import commands
prefix = "."
bot = commands.Bot(command_prefix=prefix)
@bot.command(pass_context = True)
async def say(ctx, *args):
mesg = ' '.join(args)
await ctx.delete()
return await ctx.send(mesg)
bot.run('xxxx')
感谢您的阅读:)
您从上下文中获取了消息,然后将其删除。
await ctx.message.delete()