【问题标题】:Issue with bot responding multiple times to one command discord.py机器人多次响应一个命令 discord.py 的问题
【发布时间】:2021-11-29 18:36:16
【问题描述】:

我只打开了一个控制台,我认为这是因为 on_message,因为一旦我删除了这些控制台,它只会像它应该的那样响应一次。我在使用 await self.client.process_commands(message) 之后真的不确定为什么会重复。如果您有任何建议,请告诉我。

【问题讨论】:

  • 请附上您的代码。

标签: python python-3.x discord discord.py


【解决方案1】:

我知道你正在使用CogCog.listener()

eventlistener 中的 discord.py 是 2 个不同的装饰器。例如 listenersevents 中调用。

删除这一行:

await self.client.process_commands(message)

【讨论】:

  • 你怎么能在他提供的很少的背景下知道这些事情?
  • 对不起,我不知道这个问题的答案。但我认为on_command event 和Command.before_invoke 对你有帮助。
猜你喜欢
  • 2020-07-09
  • 2021-10-06
  • 2021-06-13
  • 1970-01-01
  • 2021-08-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-09
相关资源
最近更新 更多