为什么我的机器人只是在反应 discord.py 时关闭

Why does my bot just shut off on a reaction discord.py

因此,在您执行表情符号时,我的机器人会在所有命令上关闭....为什么会发生这种情况?

Traceback (most recent call last):
  File "main.py", line 443, in <module>
    bot.run("TOKEN")
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 598, in
 run
    return future.result()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 579, in
 runner
    await self.start(*args, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 543, in
 start
    await self.connect(reconnect=reconnect)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 457, in
 connect
    await self._connect()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 421, in _connect
    await self.ws.poll_event()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/gateway.py", line 469, in poll_event
    await self.received_message(msg)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/gateway.py", line 423, in received_message
    func(data)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/state.py", line 409, in parse_message_reaction_add
    emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
KeyError: 'animated'

代码中没有动画和表情符号...

帮帮我

您似乎是 运行 旧版本 discord.py 上的机器人。

在终端中打开 python 环境并输入以下内容:

$ python3

import discord

discord.__version__

如果您 运行 的版本小于 1.3,您应该使用

更新您的 discord 模块
$ pip3 install discord.py --upgrade