Skip to content

Latest commit

 

History

History
78 lines (72 loc) · 3.2 KB

File metadata and controls

78 lines (72 loc) · 3.2 KB

Telegram Weather Bot

This is simply telegram bot, which show current weather in current place.

Bot commands:

  • /place - Input place.
  • /update - Update weather of current place.
  • /current_place - Output current place.
  • /help - Output help message.
  • /cancel - Cancel action.

Start telegram bot

  • Before start python script need open config.py and enter your telegram bot and AccuWeather tokens.

    config.py

    telegram_key = "xxx" #your telegram bot token
    weather_key = "xxx"  #your AccuWeather token
  • Selection format for saving users data is implemented. For selection format (default format is yaml) is need open file tbweather.py and correct 6 and 34 line in this file.

    6 | from Database import JSON
      | ...
    34| db = JSON(path = "users.json", indent = 4)
    6 | from Database import CSV
      | ...
    34| db = CSV(path = "users.csv", delimiter = ";")
    6 | from Database import YAML
      | ...
    34| db = YAML(path = "users.yaml", indent = 2)
  • Startup telegram weather bot pyhton script is implemented by bash script start.sh.

    Commands for first start python script :

    ~/repository_directory/start.sh -i

    or

    ~/repository_directory/start.sh --install

    This commands is install telegram weather bot requirements and run python script.

    ~/repository_directory/start.sh -r

    or

    ~/repository_directory/start.sh --run
    • Commands for output help message of bash script start.sh :
    ~/repository_directory/start.sh -h

    or

    ~/repository_directory/start.sh --help