8000
Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Shop Bot

A clean Telegram storefront built with aiogram 3: browse a catalog, add items to a cart, and place an order — the owner gets a formatted notification for every sale. A solid starting point for small shops that sell straight from Telegram.

Python aiogram 3 Docker License MIT

Features

  • Inline catalog — one tap to view a product's details and price
  • Cart — add / remove items, live totals, clear in one tap
  • Checkout flow — collects name, phone and address via an FSM conversation
  • Order notifications — the admin receives a formatted order the moment it's placed
  • Configurable — shop name and currency from environment variables
  • Swappable data layer — the catalog and cart hide behind small modules, so moving to a database is a local change
  • Docker-readyDockerfile + docker-compose.yml included

Quick start

# 1. install
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# 2. configure
cp .env.example .env
#   edit .env — set BOT_TOKEN (from @BotFather) and your ADMIN_ID

# 3. run
python -m bot

Or with Docker:

cp .env.example .env   # fill it in
docker compose up --build

How to find your admin ID

Message @userinfobot on Telegram — it replies with your numeric user id. Put that in ADMIN_ID to receive orders.

Project layout

telegram-shop-bot/
├── bot/
│   ├── __main__.py      # entry point, dispatcher wiring
│   ├── config.py        # typed settings (pydantic-settings)
│   ├── catalog.py       # products (swap for a DB later)
│   ├── cart.py          # per-user cart store
│   ├── keyboards.py     # inline keyboards
│   └── handlers/
│       ├── shop.py      # catalog + cart
│       └── checkout.py  # order FSM + admin notify
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── pyproject.toml

Notes

The catalog and carts are kept in memory to stay dependency-free. For production, back cart.py with Redis and catalog.py with your database — the handler code doesn't change, since it only talks to those modules' functions.

License

MIT — see LICENSE.

About

A Telegram storefront bot with catalog, cart and order flow, built with aiogram 3.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0