A discord weather bot that displays weather information of a given city.
- Python 3.9.9
- Python Discord.py module
- OpenWeatherMap API
- Discord API
-
Create a discord bot here and grab the token.
-
We are going to be using OpenWeatherMap API, which requires an API key, you can get one for free by simple logging in to their website.
-
Open the main.py file and replace your
DISCORD_BOT_TOKEN
andOPEN_WEATHER_MAP_API_KEY
.
token = 'DISCORD_BOT_TOKEN'
api_key = 'OPEN_WEATHER_MAP_API_KEY'
- Before running the bot you will need to install all the requirements with this command:
pip install -r requirements.txt
- Start the bot by having the cmd/terminal inside the bot folder and run the following command:
python3 main.py
- You're done, enjoy your bot!