https://github.com/macket/inspector_habit_bot
Inspector Habit helps people to develop good habits and break bad ones, fining them for laziness and weakness.
https://github.com/macket/inspector_habit_bot
python telegram-bot
Last synced: 10 months ago
JSON representation
Inspector Habit helps people to develop good habits and break bad ones, fining them for laziness and weakness.
- Host: GitHub
- URL: https://github.com/macket/inspector_habit_bot
- Owner: Macket
- Created: 2019-06-02T15:53:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-22T15:46:40.000Z (over 5 years ago)
- Last Synced: 2025-06-25T08:02:31.207Z (about 1 year ago)
- Topics: python, telegram-bot
- Language: Python
- Homepage: https://t.me/inspector_habit_bot
- Size: 2.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Inspector Habit
Inspector Habit is a Telegram bot which helps people to develop good habits and break bad ones, fining them for laziness and weakness.
## Getting Started
Inspector Habit bot requires Python 3.7 and packages specified in ```requirements.txt```.
You can install them with
```
pip install -r requirements.txt
```
Before you start Inspector Habit it is necessary to create ```.env``` file:
```
touch .env
```
and fill in this file according to the example below:
```
DEBUG = True
BOT_TOKEN = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ADMIN_ID = XXXXXXXXXXX
DATABASE_URL = postgres://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
DB_NAME = inspector_habit_db
DB_USER = user
DB_PASSWORD = XXXXXXXXXXX
DB_HOST = localhost
PROXY = https://XXX.XXX.XXX.XXX:XXXX
PROVIDER_TOKEN = XXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```
```DEBUG``` should be **False** in prod
```BOT_TOKEN``` is the token got from [BotFather](https://t.me/BotFather)
```ADMIN_ID``` is the telegram id of the admin
```DATABASE_URL``` is used to access the database in prod
```DB_NAME```, ```DB_USER```, ```DB_PASSWORD``` and ```DB_HOST``` are used to access the database in dev
```PROXY``` is used if Telegram is blocked in your country (also uncomment appropriate code in ***bot.py***)
```PROVIDER_TOKEN``` is used for payments (see ***fines/payments***), you can connect the payment provider to your bot via [BotFather](https://t.me/BotFather)
Then you can start Inspector Habit with this command:
```
python main.py
```
## Use case
Let's see how [the Dude](https://en.wikipedia.org/wiki/The_Big_Lebowski) could discipline himself with Inspector Habit and of course [Walter](https://en.wikipedia.org/wiki/The_Big_Lebowski).
First of all, the Dude starts Inspector Habit and assigns the habit he wants to develop.

Then he chooses days and time for checks, specifies his timezone and selects the amount of the fine.

Also the Dude has to choose where his money will go: to a friend or to charity.

Of course, the Dude chooses **To a friend**.

And asks Walter to become his judge.

When Walter becomes the judge he can also **Sign up** to develop his own habits.

The Dude gets notified about it and now he can see the menu.


When check time is coming, the Dude gets the following message from Inspector Habit.

It seems that he overslept and Walter is trying to remind the Dude about his promise.


But it's too late. Dude taps **❌ No** and gets fined.

If the Dude forgets to pay fine, Walter will remind him.


Once the Dude pays, Walter taps **💰 Fines paid** and everything goes on.