Automated Paytm & BharatPe Payment Verification & Instant Telegram Channel Access Bot.
An automated solution for Telegram channel/group monetization. Generates dynamic UPI QR codes, verifies Paytm and BharatPe transactions in real time via the DevPort API, and sends single-use channel invite links automatically.
- 👤 For Users & Store Owners (Quick Start)
- 💻 For Developers (Setup & Architecture)
- 🤖 Bot Commands Reference
- ⚙️ Configuration (.env Reference)
- 📞 Support & API Registration
- User runs
/startin Telegram and picks Paytm or BharatPe. - Bot generates a custom QR code pre-filled with the exact product price and order reference.
- User pays via any UPI app (PhonePe, Google Pay, Paytm, BHIM, etc.).
- Instant Verification:
- Paytm: User runs
/verify [Order_ID]. - BharatPe: User runs
/verify [UTR]OR the bot automatically detects the payment via background reconciliation.
- Paytm: User runs
- Access Delivered: The bot generates and sends a single-use invite link to your private Telegram channel/group.
- Framework: Pyrogram (Pyrofork 2.3+)
- API SDK: DevPort API (
devporton PyPI) - Database & ODM: MongoDB 7+ with Motor & Beanie ODM
- Scheduler: APScheduler (AsyncIO)
- Containerization: Docker & Docker Compose
# 1. Clone repository
git clone https://github.com/ilambit/devport-telegram-paybot.git
cd devport-telegram-paybot
# 2. Configure environment
cp .env.example .env
# Edit .env with your credentials
# 3. Build & Run
docker compose up -d --build
# View logs
docker compose logs -f bot# 1. Install dependencies
pip install -r requirements.txt
# 2. Run MongoDB locally or set MONGODB_URI to Atlas in .env
# 3. Start bot
python -m bot| Command | Example | Description |
|---|---|---|
/start |
/start |
Welcome menu, price display, & payment method selector |
/verify |
/verify ORDER_12345 |
Verify payment by Paytm Order ID or BharatPe UTR |
| Command | Example | Description |
|---|---|---|
/stats |
/stats |
Order status counts, revenue total, & API credit balance |
/pending |
/pending |
List pending orders older than 5 minutes |
/approve |
/approve ORDER_123 |
Manually approve order & issue invite link |
/reject |
/reject ORDER_123 Invalid UTR |
Reject order & notify user with custom reason |
/lookup |
/lookup 432112345678 |
Query live transaction status directly from DevPort API |
| Variable | Required | Default | Description |
|---|---|---|---|
API_ID |
Yes | — | Telegram API ID from my.telegram.org |
API_HASH |
Yes | — | Telegram API Hash |
BOT_TOKEN |
Yes | — | Telegram Bot Token from @BotFather |
ADMIN_IDS |
Yes | — | Telegram user IDs of bot admins (e.g. 123456,789012) |
DEVPORT_API_KEY |
Yes | — | DevPort Live API Key (ilm_live_...) |
PRODUCT_PRICE |
Yes | 499.00 |
Price in INR (e.g. 499.00) |
PRODUCT_NAME |
Yes | Premium Access |
Product name displayed to users |
DELIVERY_CHANNEL_ID |
Yes | — | Channel/Group ID (e.g. -1001234567890) |
PAYTM_UPI_ID |
Yes | — | Paytm merchant VPA (name@paytm) |
BHARATPE_UPI_ID |
Yes | — | BharatPe merchant VPA (name@bharatpe) |
MERCHANT_NAME |
Yes | My Store |
Store name displayed inside UPI app |
BHARATPE_POLL_INTERVAL_SECONDS |
No | 90 |
BharatPe auto-polling frequency (sec) |
MONGODB_URI |
No | mongodb://localhost:27017 |
MongoDB connection string |
MONGODB_DB_NAME |
No | telegram_payment_bot |
Database name |
The project includes unit & integration tests built with pytest and mongomock-motor:
pytest tests/ -vdevport-telegram-paybot/
├── bot/
│ ├── __main__.py # Bot entrypoint & lifecycle manager
│ ├── config.py # Pydantic Settings configuration
│ ├── keyboards.py # Dynamic Telegram inline keyboards
│ ├── db/
│ │ ├── models.py # Beanie document models (Order, RedeemedReference, etc.)
│ │ └── session.py # MongoDB Motor & Beanie bootstrap
│ ├── services/
│ │ ├── devport_client.py # DevPort API wrapper (httpx + tenacity retries)
│ │ ├── verification.py # Verification logic & single-use invite delivery
│ │ ├── alerting.py # Debounced admin DM alerts
│ │ ├── qr_generator.py # In-memory UPI QR generator
│ │ └── reconciliation.py # Background job for BharatPe auto-matching
│ └── handlers/
│ ├── start.py # /start UI & callback queries
│ ├── verify.py # /verify user command handler
│ ├── admin.py # Admin management suite
│ └── errors.py # Global error handler
├── tests/ # Automated pytest suite
├── Dockerfile # Container build script
├── docker-compose.yml # Production multi-container setup
├── requirements.txt # Pinned python packages
└── README.md # Documentation
- DevPort API Portal: devport.ilambit.in
- Get API Key: devport.ilambit.in/signup
- API Documentation: devport.ilambit.in/docs
- PyPI SDK:
devporton PyPI
This project is licensed under the MIT License.
© 2026 Ilambit DevPort. All rights reserved. Built by Ilambit Technologies