The project is organized in such a way that it consistently improves from a simple echo bot working locally to a complex tool in the hands of a business team for daily monitoring of the required indicators.
The project @ZelfAlertBot
is a telegram bot, which is part of the analytical infrastructure at ZELF and allows the startup team to monitor important business indicators on a daily basis.
You just need to create a bot using the @BotFather
interface, you need to give it a name and save the received token. This value must be set to an environment variable TOKEN
.
Also you need to specify SECRETNAME
which is used as login password, you can choose any safe string you like.
It is enough to download the latest version of the repository to your local computer, set the TOKEN
and SECRETNAME
environment variables, and modify the stats function in dataloader.py file accordance with your goals, this function will not work by default.
This is the following sandbox for exploring telebot
To start the Your first telegram bot
run the following commands:
$ pip install pytelegrambotapi
$ set TOKEN=<YOUR TOKEN>
$ python main.py
Browse the repository at this point in the history
Second telegram bot
starts on the Heroku by default, but to run locally you should just add one line to the beginning of the code above and modify the launch command:
$ pip install flask
$ python main.py --local
Browse the repository at this point in the history
Is the first intelligent version of @ZelfAlertBot
bot with simple authentication through a security question, which, for instance, can send statistics on the main metrics for yesterday. In order to run locally, you need to run a few more commands:
$ pip install gspread
$ pip install oauth2client
$ pip install df2gspread
$ set SECRETNAME=<YOUR NAME>
Browse the repository at this point in the history