为了账号安全,请及时绑定邮箱和手机立即绑定

启动时加载 discord bot 时出错。通过 repl.it 托管

启动时加载 discord bot 时出错。通过 repl.it 托管

子衿沉夜 2023-03-30 17:21:32
几天前,我的 discord 机器人突然离线,我通过 repl.it 托管我的机器人,但我无法让它工作,因为它给出了一个肮脏的错误。Traceback (most recent call last):  File "main.py", line 584, in <module>    bot.run("NTg0NjkyODA1NTcwNjU4MzEz.XPOnmw.VpE_ILHaDdQ6k--OIBRovc1h80o")  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 640, in run    return future.result()  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in runner    await self.start(*args, **kwargs)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 585, in start    await self.connect(reconnect=reconnect)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 499, in connect    await self._connect()  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 463, in _connect    await self.ws.poll_event()  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/gateway.py", line 471, in poll_event    await self.received_message(msg)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/gateway.py", line 425, in received_message    func(data)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/state.py", line 750, in parse_guild_create    guild = self._get_create_guild(data)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/state.py", line 725, in _get_create_guild    guild._from_data(data)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/guild.py", line 297, in _from_data    self._sync(guild)  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/guild.py", line 328, in _sync    self._add_channel(CategoryChannel(guild=self, data=c, state=self._state))这是在控制台中,我不知道这是什么意思。我们没有更改任何代码,它只是离线并停止工作。
查看完整描述

2 回答

?
隔江千里

TA贡献1906条经验 获得超10个赞

只需更新 discord.py 模块。Discord 将 api 域从 discordapp.com 切换到 discord.com。这就是代码崩溃的原因。



查看完整回答
反对 回复 2023-03-30
?
函数式编程

TA贡献1807条经验 获得超9个赞

您可以转到 packages 并卸载当前的 discord.py 模块。然后重新添加它。没有直接更新 discord.py 模块的功能。所以你必须卸载并重新安装。[为我工作]



查看完整回答
反对 回复 2023-03-30
  • 2 回答
  • 0 关注
  • 108 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信