Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.95 KB

README.md

File metadata and controls

50 lines (30 loc) · 1.95 KB

Sataako-bot

This is a Telegram bot that uses the sataako -service to inform users of rainfall in the Helsinki metropolitan area.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Python and pipenv installed on the machine that you want to run the bot on. In addition you need a Telegram API key for the bot.

Installing

Clone this repository, navigate to it on the command line and run the command below.

pipenv install

Setting environment and configuration variables

You have to set specific configuration variables that the app will use.

  • TELEGRAM_API_TOKEN - The Telegram API token for your bot.
  • APP_NAME_HEROKU - The name of your Heroku app; only required if you are deploying the bot to Heroku.
  • SATAAKO_SERVER_URL - The url of the Sataako backend server with no "/" at the end.
  • RAIN_WARNING_QUERY_INTERVAL - The length of the interval for making queries to the server about rainfall at a location.

Local deployment

Once you have everything installed and the Telegram API token set the environment variables, you can start running the bot on your local machine.

Navigate to the directory on your command line and open the virtual environment shell. From that shell run command below.

python sataakobot.py --deploy-local

Heroku deployment

Set the configuration variables mentioned above to your Heroku app and then push the repository to the Heroku remote of your app.

Built with

  • pipenv - Package and virtual environment management.
  • python-telegram-bot Telegram bot wrapper that was "simply too good to refuse."

License

sataako/sataako-bot is licensed under the MIT License.