【发布时间】:2019-05-13 12:14:44
【问题描述】:
我想在触发时删除单个消息,但我无法弄清楚。我与await ctx.channel.purge 合作进行了清除工作,但这不是我想要的,因为这需要一定数量
旧版本写成await self.bot.delete_message(ctx.message),但现在带来了错误object has no attribute 'bot'
阅读文档我只能找到Message.delete,但这会带来错误:NameError: name 'Message' is not defined
我确信这是一个简单的解决方案,但我无法解决。在此先感谢
我当前的代码是:
@commands.command(pass_context=True)
async def say(self, ctx, *args):
'''Make Bot repeat your messages'''
mesg = ' '.join(args)
await Message.delete(ctx.message)
await ctx.send(mesg)`
【问题讨论】:
标签: python discord discord.py discord.py-rewrite