How do I deploy a Discord Bot in Python to Heroku? How do I deploy a Discord Bot in Python to Heroku? heroku heroku

How do I deploy a Discord Bot in Python to Heroku?


I'll break down the places which breaks the deploy into points-

  1. requirements.txt Your requirements file does not have the == required. Open CMD in the folder where your heroku python script is stored, and type pip freeze. Then copy/paste everything into your requirements.txt file. It should look like this in the end.

  2. BOT TOKEN It doesn't break the deploy, but is very dangerous. Anyone can view your bot token here, which means they have full control over your bot. I recommend making 2 seperate folder for your bot, one pushes to heroku with your token, the other pushes to github with a placeholder for the token

If you build your deploys from github, then you have to pay to get a private repo. I recommend instead pushing from the CLI to heroku and github seperately, it's actually pretty easy.

  1. runtime.txt I'm not entirely sure about this, but it's not the latest version(3.6.4) supported. Leaving it be should be OK, so just ignore this

This should fix your deploying issue, if you have a doubt then you can check my guide or just reply to this :)