- Python 3.9.2
- OpenWeatherMap API
- Discord API
- Heroku
pip3 install discord.py
pip3 install requests
Create a Procfile in your project's root directory and add following to it. It will contain a worker command that will start the bot.
worker: python main.py
Create a requirements.txt file and add required libraries to it.
# creates the output installed packages in requirements format.
pip freeze > requirements.txt
Create a runtime.txt file in your project's root directory and add following to it.
# python version
python-3.9.2
Add OpenWeatherMap API and Discord Bot Token to Config Vars
Connects Heroku app to Github repository.
Choose Deploy Branch and enable Auto Deploy.
After then it will be look like thw following image.
Enable the Dynos.
Test the bot!
The bot will now be online and ready to serve 24/7. If we commit on the remote repository, the bot will be updated and deployed automatically.