Telegram bot that provides weather data from the OpenWeather API based on your current location.
- Clone this repository using:
git clone https://github.com/venyxD/weather-bot.git
- Create new Telegram bot with BotFather
- Copy your bot API token into
config.py
:
BOT_API_TOKEN = 'Paste your bot API token here'
- Create an account on OpenWeatherMap
- Copy your OpenWeather API token into
config.py
:
OPENWEATHER_API_KEY = 'Paste your OpenWeather API token here'
- Optional: Go to the project root directory and install the virtualenv library using pip and create a virtual environment. Run the following commands respectively:
pip install virtualenv
virtualenv venv
source venv/bin/activate
- Download and install all dependencies in the requirements.txt using
pip install -r requirements.txt
- Start bot:
$ python bot.py
- Open your bot in Telegram and start it with
/start
command
- Python 3
- AIOGram
- OpenWeather API
Weather response based on current location only works on iOS and Android mobile devices, not on Telegram desktop app because it does not provide device location.
- Add
aiohttp
support to make async http requests - Add other cities, not only current location
- Add OpenWeather forecast