/che-weather-bot

Telegram bot that can get the current weather from your IP address

Primary LanguagePythonMIT LicenseMIT

ShtoshWeatherBot

GitHub last commit GitHub GitHub repo size

YouTube Video Views

Telegram bot that can get the current weather from your IP address

demo

Getting started

  1. Clone this repository to your local machine:

git clone https://github.com/lesskop/shtosh-weather-bot.git

  1. Install Python 3.10+ version

  2. Create a virtual environment. Not necessary, but highly recommended.

  3. Install requirements:

pip install -r requirements.txt

  1. Create an .env file in the root of your project directory and add your Telegram bot API token:

BOT_API_TOKEN=bot-token-here

  1. Create an account on OpenWeatherMap

Hint: you can use temporary mail :)

Сopy and paste the API key into .env file

WEATHER_API=api-key-here

  1. Run bot.py from project directory:

python .\shtosh-weather-bot\bot.py

Usage

This Telegram bot supports the following commands:

  • /start - Start the bot and get a welcome message with the weather at your location.
  • /help - Display the available commands.
  • /weather - Display the weather.
  • /wind - Display wind speed and direction.
  • /sun_time - Display sunrise and sunset times.

License

This Telegram bot is open source and available under the MIT License.


YouTube video

Статья на Хабре