【发布时间】:2021-06-13 03:34:50
【问题描述】:
@bot.command()
@commands.has_permissions(manage_messages=True)
async def purge(ctx, amount: int):
await ctx.channel.purge(limit=amount)
await ctx.send(f'Successfully purged {amount} messages.')
^^ 这只是命令之一。每次我使用它时,它都会粘贴两次“成功清除 {amount} 消息”。有谁知道如何解决这个问题?
【问题讨论】:
-
您是否有可能运行 2 个机器人实例?也许您运行了它,在某个地方丢失了窗口并再次运行它?
-
打开进程管理器(
Ctrl + Shift + Esc在windows上)并搜索隐藏的python进程,如果你通过IDE运行你也可以关闭它,如果不起作用你可以尝试重新启动你的电脑 -
这能回答你的问题吗? Bot executing the same command twice
标签: python discord discord.py