如何将反应删除记录到另一个频道?不和谐.py

时间:2021-01-09 04:15:18

标签: python logging discord.py

我有反应添加工作得很好。但是,当我尝试去除反应时,什么也没有发生。没有错误消息或任何内容。

subprocess.run(['find', gpu_pci_device_path + '/hwmon/hwmon*', '-maxdepth', '0'], stdout=subprocess.PIPE, shell=True).stdout.decode('utf-8')

这是我正在使用的代码。任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:1)

只有在内部消息缓存中可以找到消息时才会调用此事件。

来源:https://discordpy.readthedocs.io/en/latest/api.html#discord.on_reaction_remove

确保您正在对机器人启动后发送的消息进行测试。

或者,您可以切换到使用 on_raw_reaction_remove,因为无论消息是否在缓存中,都会调用该事件。但是,此事件需要您的机器人中的 reactions gateway intent


在调试和分析库源代码后,版本 1.5.0 - 1.6.0 将返回 _get_reaction_user 为 None 并且不会触发 on_reaction_remove 事件,这似乎是 Discord 中的错误。 py。启用服务器成员意图没有帮助。 可以找到一个描述行为的 Github 问题:https://github.com/Rapptz/discord.py/issues/5867 如果不能选择使用 on_raw_reaction_remove,则回滚到 1.4.2 版是可行的。