Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pazurkota/weather_bot
For @codedex-io final project. A simple weather discord bot
https://github.com/pazurkota/weather_bot
Last synced: 5 days ago
JSON representation
For @codedex-io final project. A simple weather discord bot
- Host: GitHub
- URL: https://github.com/pazurkota/weather_bot
- Owner: pazurkota
- License: mit
- Created: 2024-07-17T11:56:50.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-07-25T14:58:17.000Z (4 months ago)
- Last Synced: 2024-07-25T17:12:42.614Z (4 months ago)
- Language: Python
- Homepage:
- Size: 510 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weather Bot
*Simple weather Discord bot created for [Codédex](https://www.codedex.io/home) final project!*![](https://img.shields.io/github/license/pazurkota/weather_bot?style=for-the-badge)
![](readme_image.png)
---
### Cloning repo:
To clone repository, you can use Git client like GitKraken or Tower, or just simply type:
```commandline
git clone https://github.com/pazurkota/weather_bot.git
```---
### Running bot:
Prerequisites:
- [Discord Bot Token](https://discord.com/developers/applications) with all intents
- [OpenWeather API](https://openweathermap.org/api) keyTo run this bot:
1. Make sure you are running `Python 3.8` or newer
2. You need both `requests` and `discord` packages installed:
```commandline
python -m pip install requests
```
```commandline
python -m pip install -U discord.py
```
3. Create `data.json` file in root directory (where `program.py` is localized) with following data:
```json
{
"token": "DISCORD BOT TOKEN",
"api_key": "API KEY FROM https://openweathermap.org/"
}
```
4. Open project with PyCharm or any other IDE
5. Run the project---
### Commands:
The bot prefix is `$`
- `$weather ` - Get current weather for specified city
- `$aqi ` - Get current air quality for specified cityIf your location have more than one word, type name in quotes, e.g. `$weather "New York"`
---
### Project structure:
This bot is simple, but some files are in separate folders for better organization:
- `data` - contains all methods to get data neither from API or `data.json` file
- `parse` - contains all methods to parse data from API and return it as Discord Embed---
### Appendix:
This was my first project with Python, so any feedback is appreciated! If you have any questions, feel free to ask me on Discord `@pazurkota`Also, any suggestions for new features or contributions are welcome!