Telegram-  :    ,    
 


   ,     Telegram-,

   .

      .  

 :  ,  , ,   

Telegram Stars    ,    .

:   ,     ; 

   ;     ;  

;      ;  ; 

      ;     

,   .

    .    ,   

      ,   .

      2026 .





 

Telegram-  :    ,    





 1. :      


  ,     .   :      ,                .

  

     Telegram-  10 .      ,    !   /start.   ,    :       ,    ,     ,        ,      ,  .

     :     ,          .  ,      .

       .    ,   ,   .          ,   ,     .

 

 ,        .         ,      ,   . ,   , ,     .

     ,         ,   .

 

     :

  ,    Telegram;

  ,      ;

  ,     ;

    Telegram Stars   ,    ;

 ,     ,    ;

 ,    .

     .   10 ,     .

  

    ,       .

       .    Telegram-   ,  .      .  App Store,  Google Play,  Chrome Web Store,         .        :    , , , .

     ,      ,      .       .      .

        .  :   ,     ,   ,         ,    - .     .

     .      ,    .     ,   .

 

   Telegram: ;   Python: ;  GitHub: ;  (Render,  ): ;   (UptimeRobot): ;    : ~$7/.

?   Telegram: ;   Python: ;  GitHub: ;  (Render,  ): ;   (UptimeRobot): ;    : ,     .

      .         ,          .

 

    2026 .  ,          ,   .

    :

:   Telegram Stars     2026: 1000 

:        2026: 21 

:         2026:  $0,013

:   Render     2026:   ,   

:   aiogram     2026: 3.x

      ,   .         ,      :  @BotFather,  fragment.com     .    ,   .

    :   ,  ,   ,         .    ,     .

 

     .    ,     .   3, 5  10        .  11 ()    ,     - :    ,   .




 2.  ,    


   ,      .    .

 

Telegram-    : ;   : ;   : ;  : Stars  ;    : ;   :  .

     : $25 Google Play, $99/ Apple;   : 114 ;   : , ;  :    30%;    : ;   : .

Chrome-    : $5 ;   : 17 ;   : ;  :  ;    : ;   : .

/-    : ;   : ;   :  ( SEO);  : ;    : ;   :  .

  :    

  .    ,  ,  ,  .     .        ,    .

    :      ,      .        .       :  ,    ,     .

   . Telegram Stars   ,          .        30%,           .

  :  

 ,      .

 Google Play  App Store  .         ,  .    ,   , ,   .     Chrome Web Store.

 Telegram-  .   Telegram           ,   ,   .    ,       .

 :      ,   ,   .            , , .   ,     ,    .

    

       .

    : , -,  .

         ,    .

      .

   

            ,   .

    : , ,  .    .

   .

 : Telegram Mini App

    Mini App.   -   ,    Telegram.  Stars    ,   .

Mini App   ,             .    ,        ,   ,    .



          .    ,  :    .        ,    .




 3.  : BotFather  


  .   .

 

   Telegram       @BotFather.

  Telegram   @BotFather (        ).

  Start.

   /newbot.

 BotFather     ,      .    ,  :  .

   username    .  ,     bot:  habit_tracker_bot.

 username   BotFather   ,  .    ,   .

  BotFather       :

1234567890:AAHrZmPlXqK3vN8dWfYtBcE5gJ7nQsL2xVw

     

  ,     .

     . ,    ,     ,    ,   .            ,       .

 :

       , ,       .

      .   .

   -     BotFather, /mybots     API TokenRevoke current token.   ,   .

   

    .env   .   :

BOT_TOKEN=1234567890:AAHrZmPlXqK3vN8dWfYtBcE5gJ7nQsL2xVw

     ,        .      .gitignore  :

.env

Git   .env        .

   (    ) ,   ,   - .env.example     ,    :

BOT_TOKEN=paste_your_token_from_botfather_here

        ,    .

  

   BotFather,    ,   .  /mybots     Edit Bot:

 Edit About      ,  120 .

 Edit Description  ,      Start,  512 .   : ,       .

 Edit Botpic  .  ,      .

 Edit Commands   ,     /   .

     ,     ,       .   ,    5.

 

   ,  ,   .    ,   :

https://api.telegram.org/bot<_>/getMe

  ,    JSON   :

{"ok": true,

"result": {

"id": 1234567890,

"is_bot": true,

"first_name": "Habit Tracker",

"username": "my_habit_tracker_bot"

}}

  {"ok":false,"error_code":401}     .

                 .

 

     :  , ,  ,    ,   .         .     5,    ,     .




 4.    MVP


MVP    ,     .      ,    .

 

     ,      .     ,   ,     ,       .

    :         ?        .

:  

 ,     .  : *    *.

  MVP:

:     :    

:     :    

:  (  )   :   

:     :      

:     : ,  

   MVP ( ):

     ;

    ;

    ;

  ;

   ;

   .

      .     ,         .         .

   ,   MVP

 ,   ,      .

   . ,     Start, ,   .          .     ( ,  10 , )  :  ,     .

  .   Start, , .        .                .

  .       . ,      ,       .    ,   .

 ,   

      **:   ,  .      :    ,      .

    ,   ,    ,   .            ,    . ,   40  ,         ,     .

      ,  :      .     .         ,       .  .       ,    .

    :

    (, );

 ,      ;

   ,    .

 :

  ,     (   );

 ,     .

 

             ,   .      ,      .

   .   (12 )   .   (30 )    ,      .     57 .

      .  ,  .  ,       ,     .

   

     ,   :

   []  [],      [  ].

     :

      ,           .

,      ,  MVP  .




 5.  : aiogram   


     .      .

            13:  ,               .

  

Python  ,    .   python.org,  3.10  .    Windows    Add Python to PATH,     .

,  :

python --version

   .



    .      requirements.txt:

aiogram>=3.4,<4.0

APScheduler>=3.10,<4.0

python-dotenv>=1.0

aiohttp>=3.9

  :

 aiogram      Telegram.        Telegram.

 APScheduler  ,     ( ).

 python-dotenv      .env.

 aiohttp  -,    ( 10).

  :

pip install -r requirements.txt

 

     .    ,           .

main.py         :  

db.py           :    -

handlers.py    :      

scheduler.py     

  : handlers.py ,    , db.py ,    .           Telegram.

 

      SQLite  ,          .    Python,    .

 :   .

SCHEMA = """

CREATE TABLE IF NOT EXISTS users (

user_id INTEGER PRIMARY KEY,

created_at TEXT NOT NULL,

trial_end TEXT NOT NULL,

subscribed_until TEXT,

reminder_time TEXT NOT NULL DEFAULT '09:00'

);

CREATE TABLE IF NOT EXISTS habits (

id INTEGER PRIMARY KEY AUTOINCREMENT,

user_id INTEGER NOT NULL,

name TEXT NOT NULL,

streak INTEGER NOT NULL DEFAULT 0,

last_done TEXT,

created_at TEXT NOT NULL,

FOREIGN KEY (user_id) REFERENCES users(user_id)

);

"""

user_id      Telegram.     ,    ,       .

       ,        :

import sqlite3

from contextlib import contextmanager

DB_PATH = "bot.db"

@contextmanager

def get_conn():

conn = sqlite3.connect(DB_PATH)

conn.row_factory = sqlite3.Row

conn.execute("PRAGMA foreign_keys = ON")

try:

yield conn

conn.commit()

finally:

conn.close()

row_factory = sqlite3.Row       (row["streak"])      .

 

       .     ,  :     .

from datetime import datetime, timedelta

TRIAL_DAYS = 5

def get_or_create_user(user_id: int):

with get_conn() as conn:

row = conn.execute(

"SELECT * FROM users WHERE user_id = ?", (user_id,)

).fetchone()

if row:

return row

now = datetime.utcnow()

trial_end = now + timedelta(days=TRIAL_DAYS)

conn.execute(

"INSERT INTO users (user_id, created_at, trial_end) VALUES (?, ?, ?)",

(user_id, now.isoformat(), trial_end.isoformat()),

)

return conn.execute(

"SELECT * FROM users WHERE user_id = ?", (user_id,)

).fetchone()

   ?       .   ,  :      SQL  ,     .

 

   - ,     .

def mark_habit_done(habit_id: int, user_id: int):

"""     .

 (, ____)."""

today = datetime.utcnow().date().isoformat()

with get_conn() as conn:

row = conn.execute(

"SELECT * FROM habits WHERE id = ? AND user_id = ?",

(habit_id, user_id),

).fetchone()

if row is None:

return None, False

if row["last_done"] == today:

return row["streak"], True

yesterday = (datetime.utcnow().date() - timedelta(days=1)).isoformat()

new_streak = row["streak"] + 1 if row["last_done"] == yesterday else 1

conn.execute(

"UPDATE habits SET streak = ?, last_done = ? WHERE id = ?",

(new_streak, today, habit_id),

)

return new_streak, False

 ,    :

       ,   .          ,    .

     ,   .

       ,    .

:       id,   user_id.    ,       ,   .

:   

 handlers.py.      .

from aiogram import Router

from aiogram.filters import Command

from aiogram.types import Message

import db

router = Router()

@router.message(Command("start"))

async def cmd_start(message: Message):




  .


   .

   ,     (https://www.litres.ru/pages/biblio_book/?art=74252013)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


