A simple Discord Bot you can edit and host yourself. Uses discord.py as a framework and openweathermap.com API for free live weather data.
Command | Example | Description |
---|---|---|
help |
!help | Lists all avalible commands, and a small explanation on how to use them. |
about |
!about | Displays a few informations about the bot e.g.: the Python version running. |
weather [City/Location] |
!weather London | Shows current temperature, humidity, pressure, windspeed, percieved temperature, as well as cloud coverage and precipitation. |
forecast [City/Location] |
!forecast New york | Gives out the temperature and a litte description with an Emoji for the next 24h in 3 hour intervals. |
rain [City/Location] |
!rain Paris | Quick feedback if its about to rain in the next hour and if yes, how much will come down. |
air [City/Location] |
!air Tokyo | Gives out a small rating of Air quality and then a listing of individual concentrations of gases and particles. |
Python 3.5.3
and up - https://www.python.org/downloads/discord.py
- Usingpip install discord.py
will install the latest version. Read the Docs here.- The Python code for the Bot itself - Download the latest release
- Create discord Bot token: https://discord.com/developers/applications
- Register on openweathermap.com and get an API key: https://home.openweathermap.org/users/sign_up
- Common Prefixes are
_
!
?
.
- It is better to use a prefix that no other bot on your server already uses
- Go to the Discord Developer Portal
- Select your Application
- Select
OAuth2
thenURL Generator
- Under
Scopes
, tickbot
- For
Permissions
you only need to tickSend Messages
andRead Message History
- Open the generated URL at the bottom
- Select your server and confirm
Now you have finished setting up your bot.
Run bot.py with python3 bot.py
from the directory.
After a few seconds the bot should come online on your Server.