Skip to content

Eqwe-Wewe/PythonWeatherTeleBot

Repository files navigation

PythonWeatherTeleBot

⛅ Telegram bot for showing weather

About PythonWeatherTeleBot:

A pretty simple telegram bot for showing the weather on the territory of Russia.
The data is parsed with Yandex.Weather.
The interface is in Russian.

Features:

  • weather now


  • weather today



  • 10-day weather forecast



  • choosing the weather in the right city or area


  • storing user parameters for the bot operation

For running application:

Getting started.

  • create a Telegram bot using @BotFather

    It needs to be configure:

    • a description and text about the bot (commands /setdescription and /setabouttext)
    • a profile photo (/setuserpic)
    • enable the inline mode (/setinline)
    • add command descriptions (/setcommands):
      weather_now - погода сейчас
      weather_today - подобный прогноз на сегодня
      10_day_forecast - прогноз погоды на 10 дней
      choosing city or area - изменение места для прогноза погоды
      help - помощь
  • save the token to a config_tb.py

    TOKEN = '<your_token>'
  • create a table in the selected database to store user properties:

    • configure the PostgreSQL login for use in config.db(example)
    pyconfig = {
          'user': '<randomuser>', 
          'password': '<randompassword>',
          'host': '<randomhost',
          'port': '<randomport>',
          'database': '<randomdatabase>'
    }
    • launch create_table.py
    • or set the path to the file in the SQL shell
      SOURCE users_property.sql
  • launch main.py