繁体   English   中英

为什么我的机器人只是在反应 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM