首页 > 解决方案 > 我的 herkou discord.py 机器人没有启动,也没有出现任何错误

问题描述

嗨,我在 heroku 上托管我的机器人。我的第一个机器人在线但是当我更改代码时它停止在线并且我在日志中没有收到任何错误。

您可以在https://github.com/reyyan987/organic查看我的代码

日志:

2021-02-27T13:29:06.299355+00:00 heroku[worker.1]: Starting process with command `python filename.py`
2021-02-27T13:29:07.003029+00:00 heroku[worker.1]: State changed from starting to up
2021-02-27T13:29:10.755961+00:00 heroku[worker.1]: Process exited with status 0
2021-02-27T13:29:10.819759+00:00 heroku[worker.1]: State changed from up to crashed

标签: pythonherokusyntax-errordiscord.py

解决方案


你忘了运行你的机器人client.run。我查看了您的电话,procfile而您正在拨打的电话filename.py没有运行机器人。要解决您的问题,只需setupfilename.py. 您还需要更改bot.run为,client.run因为这就是您正在使用的。


推荐阅读