Home > database >  Python Discord Bot on Heroku doesn't work
Python Discord Bot on Heroku doesn't work

Time:10-16

I deployed Discord on Heroku successfully, but it still doesn't work. It runs fine locally, but I can't get response from Heroku hosted variant. Here's Github repository: https://github.com/MidnightSonor/malifaux_discord_bot. Here's runtime log.

2022-10-13T12:44:01.000000 00:00 app[api]: Build started by user [email protected]
2022-10-13T12:44:22.188723 00:00 app[api]: Release v18 created by user [email protected]
2022-10-13T12:44:22.188723 00:00 app[api]: Deploy 56113237 by user [email protected]
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!

CodePudding user response:

Thanks to @Chris and @DenverCoder1 I got the answer. But it's mostly general recommendations and notes for discord.py and heroku firsttimers:

  1. Check which project you deploy! You can change it by heroku remote.
  2. Check your bot's intents both on Discord Developer Portal and in code when you declare client or bot types! I used discord.Client(intents=discord.Intents.all()) for this purpose.
  3. Read your runtime logs! Man, Im blind.
  • Related