discord.py bot随机崩溃

时间:2020-02-05 15:40:00

标签: python discord discord.py

我使用的是discord.py v0.16.12,有时会得到使机器人崩溃的回溯。该令牌存在并且有效,即使回溯导致您相信其他情况。

Traceback (most recent call last):
  File "main.py", line 94, in <module>
    bot.run(auth.get('discord', 'TOKEN'))
  File "/home/ubuntu/.local/lib/python3.6/site-packages/discord/client.py", line 519, in run
    self.loop.run_until_complete(self.start(*args, **kwargs))
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/discord/client.py", line 491, in start
    yield from self.connect()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/discord/client.py", line 448, in connect
    yield from self.ws.poll_event()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/discord/gateway.py", line 431, in poll_event
    yield from self.received_message(msg)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/discord/gateway.py", line 390, in received_message
    func(data)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/discord/state.py", line 256, in parse_message_update
    message.embeds = data['embeds']
KeyError: 'embeds'

1 个答案:

答案 0 :(得分:2)

an issuewas fixed带有discord.py v1.2.0的版本。

v0.16.12是discord.py的过时版本,不再受支持。
您应该查看migrating to v1