Skip to content

Macket/inspector_habit_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

Then you can start Inspector Habit with this command:

python main.py

Use case

Let's see how the Dude could discipline himself with Inspector Habit and of course Walter.

First of all, the Dude starts Inspector Habit and assigns the habit he wants to develop.

1

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

2

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

3

Of course, the Dude chooses To a friend.

4

And asks Walter to become his judge.

5

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

6

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

7

8

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

9

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

10

11

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

12

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

13

14

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

About

Inspector Habit helps people to develop good habits and break bad ones, fining them for laziness and weakness.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages