Giter Club home page Giter Club logo

inspector_habit_bot's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.