我成功地在Heroku上部署了Discord,但它仍然不起作用。它在本地运行得很好,但我无法从Heroku托管的变体中获得响应。这是运行时日志。
2022-10-13T12:44:01.000000+00:00 app[api]: Build started by user dashevsky.andry@gmail.com
2022-10-13T12:44:22.188723+00:00 app[api]: Release v18 created by user dashevsky.andry@gmail.com
2022-10-13T12:44:22.188723+00:00 app[api]: Deploy 56113237 by user dashevsky.andry@gmail.com
2022-10-13T12:44:24.832319+00:00 heroku[worker.1]: State changed from crashed to starting
2022-10-13T12:44:26.000000+00:00 app[api]: Build succeeded
2022-10-13T12:44:26.365888+00:00 heroku[worker.1]: Starting process with command `python3 main.py`
2022-10-13T12:44:26.952729+00:00 heroku[worker.1]: State changed from starting to up
2022-10-13T12:44:27.929643+00:00 app[worker.1]: [2022-10-13 12:44:27] [INFO ] discord.client: logging in using static token
2022-10-13T12:44:28.683273+00:00 app[worker.1]: [2022-10-13 12:44:28] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: bf35f7b917978582c1cb6a861dba38eb).
2022-10-13T12:44:30.686669+00:00 app[worker.1]: Malifaux Deck Bot#4754 has connected to Discord!
1条答案
按热度按时间px9o7tmv1#
感谢@Chris和@DenverCoder1,我得到了答案。但主要是对www.example.com和heroku新手的一般性建议和注意事项discord.py:
1.检查您部署的项目!您可以通过
heroku remote
更改它。1.当你声明
client
或bot
类型时,在Discord开发者门户和代码中检查你的机器人的意图!我使用了discord.Client(intents=discord.Intents.all())
。1.看你的运行日志!伙计,我瞎了。