🇬🇧 English | 🇮🇷 فارسی | 🇷🇺 Русский | 🇨🇳 中文
An automated Telegram V2Ray sales platform with a dedicated Mini App, AI support assistant, Android management app, web administration, multi-level reseller support, and Persian/English UI.
- 📖 Overview
- ✨ Features
- 🧠 AI Support Assistant
- 💳 Payment Gateways
- 📲 Telegram Mini App
- 🖥️ Standalone Web Admin Panel
- 📱 Android Management App
- 🔌 Supported VPN Panels
- 🖥️ Requirements
- 🚀 One-Line Automatic Installation
- 🛠️ Manual Installation
- ⚙️ Environment Variables
- 🧰 manage.sh
- 🗂️ Project Structure
- 🧪 Technology Stack
- 🔎 Additional Features
- 🤝 Contributing & License
ShopVPN is a production-oriented Telegram bot for selling and managing V2Ray/VPN configurations. It combines automated provisioning, multiple payment methods, reseller management, AI support, a Telegram Mini App, a standalone web admin panel, and Android management infrastructure.
The project is designed for real-world operation, with wallets, referrals, discounts, support tickets, monitoring, backups, reports, configurable products, and multi-bot reseller support.
- 📢 Project: @celenorbot
- 👤 Author: @celenor
- 🔑 Automatic configuration delivery on supported VPN panels
- 💳 Multiple automatic payment methods
- 🧠 AI support assistant
- 🔄 Flexible service renewal
- 🏢 Independent and linked reseller modes
- 🖥️ Telegram admin + web admin + Android management app
- 📲 Telegram Mini App storefront
- 🌍 Server map and panel health monitoring
- 🌐 Polling and Webhook support
- 🚀 Anti-spam, reports, backups, cashback, coins, lottery, gifts and Integration API
Detailed sections are collapsed below. Click any section to expand it.
🤖 Main Bot — click to expand
- 🔑 Unique configuration inventory per user with automatic provisioning
- 🔗 Direct product-to-panel assignment
- 🔄 Free-form renewal by traffic/time amount
- 👤 Unified My Account for purchased, gifted and test services
- 🧪 Multiple configurable test plans
- 🔢 Multi-quantity purchases with automatic total calculation
- 💱 Automatic USD/USDT exchange-rate lookup with fallback rates
- 💰 Internal wallet with top-up requests and admin approval
- 🗂️ Product/category management with pricing and stock controls
- 🚫 User blocking and mandatory channel membership
- 📊 Live subscription information and expiration/traffic reminders
⚠️ Low-stock alerts for administrators- 📱 Configuration delivery as text + QR code
- 🎫 Support tickets and live support chat
- 🎨 Customizable main-menu layout, labels and colors
- 🏷️ Store branding controls
- 🏢 Independent reseller bots with isolated databases
- 🌐 Polling or Webhook mode
- 💾 Persistent FSM state on SQLite
- ⏳ Temporary/sensitive-message cleanup
- 📣 Channel advertising and deep-link utilities
🤝 Resellers, Referrals, Discounts & Wallet — click to expand
- 🏢 Linked reseller mode inside the main bot
- 🤖 Independent reseller bots
- 👥 Referral links with multiple reward models
- 💸 Percentage commissions and fixed wallet rewards
- 🎁 Free configuration rewards after referral thresholds
- 🏷️ Discount codes with limits, expiration and product/category scope
- 🎡 Lucky wheel with configurable rewards and cooldown
- 🪜 Reseller tiers, fees, expiration, reminders and credit limits
- 📦 Product-based reseller supply
- 💰 Wallet and cashback features
👑 Telegram Admin Panel — click to expand
- 👑 Owner, Admin, Mid-level Admin and Support roles
- 📢 Broadcast messaging
- 📈 Sales statistics with date filters
- 📝 Full administrator audit logs
- 🗄️ Automatic daily backups to Telegram
- ♻️ Immediate backup and full database restore
- 📅 Jalali/Persian calendar support
- 👥 Users, products, categories, gateways, panels and reseller management
- 🎫 Support, reports and system settings
🚀 Growth, Security & Monitoring — click to expand
- 🛡️ User anti-spam/rate limiting
- 🎟️ Advanced discount-code limits
- 🔒 Sensitive payment/card message cleanup
- 🩺 VPN panel health monitoring and recovery alerts
- 📊 Daily sales reports
- 📣 Topic-based report groups
- 🎁 Bulk traffic/time gifts
- 🧹 Automatic cleanup of expired services
- 🔌 Token-scoped Integration API
- ⏸️ On-hold services that start expiration on first connection
- 📦 Per-panel capacity limits
- 📍 Service location/panel migration
- 💰 Bulk product price editing with undo
- 💸 Renewal/wallet cashback
- 🎁 Wallet top-up gift codes
- 🪙 Coins and scheduled lottery
- 🎫 Department-based support tickets and outage reports
Click to expand
The AI layer answers repetitive customer questions before escalating to human support.
- 🔌 Selectable providers: Gemini, Groq or OpenRouter
- 📚 Administrator-managed FAQ knowledge
- 🔎 Real user-specific answers for services, expiration, wallet and orders
- 🛒 Real purchase cards with current prices and payment buttons
- 🔒 No direct financial/write operations by the AI
- 🙋 Automatic escalation for financial complaints or explicit human-support requests
- ⚡ If no API provider is configured, requests can go directly to human support
Supported payment methods — click to expand
| Method | Confirmation | Notes |
|---|---|---|
| 💳 Manual card-to-card | Admin | Receipt/image flow |
| 📲 Bank SMS card-to-card | Automatic | Unique invoice amount and rotating cards |
| 🏧 Aban Gateway | Automatic | API-based invoice and verification |
| 💎 Plisio | Automatic | Crypto with callback/signature validation |
| 🔵 Blupal | Automatic | Automated card-to-card |
| ⭐ NoaPay / Telegram Stars | Automatic | Telegram Stars |
| 🟡 ZarinPal | Automatic | Main bot |
| 🔵 Mr. Pardakht | Automatic | Main bot |
| 💸 Tetra98 | Automatic | Main bot |
| 💳 CubePay | Automatic | Main bot |
| 💰 NowPayments | Automatic | Crypto invoice + IPN |
| ⭐ Telegram Stars | Automatic | Native XTR invoices |
| 🧩 Generic Gateway | Automatic | Configure HTTP APIs without writing code |
All gateways are independent and can be enabled or disabled separately.
Click to expand
The miniapp/ directory contains a full Telegram Mini App with both a customer storefront and web administration.
- ⚡ FastAPI backend with secure Telegram
initDataverification - 🎨 Responsive storefront
- 🛒 Products, cart, wallet, lucky wheel, referrals and test configurations
- 🔔 Expiration and traffic alerts
- 📲 Add subscriptions to popular VPN apps using deep links
- 🎫 Support tickets and live support chat
- 🌐 Persian/English switch with automatic RTL/LTR direction
- 📊 Dashboard and order exports
- 🗂️ Categories, products, panels and configuration management
- 🏢 Reseller management
- 🏷️ Discounts, lucky wheel, referrals and reminders
- 👥 User search, blocking and targeted broadcasts
- 💰 Wallet lookup and balance adjustments
- 🎨 Branding and theme customization
- 🧩 Telegram main-menu layout management
- 🎫 Ticket/support management
- 📝 System and admin logs
- 🗄️ Backup and database restore
Click to expand
The admin_panel/ package provides a standalone web administration panel independent of Telegram.
- 🔐 Username/password login with independent sessions
- 👥 Separate web-admin roles and permissions
- 📊 Sales, orders, wallet and system dashboards
- 🎨 Multiple visual themes
- 📱 PWA installation on mobile
- 🌍 Global server map and health checks
- 💱 Exchange-rate management
- ✅ Order, wallet and payment approval
- 🏢 Reseller management and analytics
- 🎫 Support tickets and conversations
- 📢 Broadcast messaging
- 🗄️ Backup and restore
- 🔔 Web Push notifications
- 📱 Android app token management
- 📝 Web-admin audit logs
- 🌐 Persian/English UI with automatic RTL/LTR
Automatic: use the relevant manage.sh option for the web panel.
Manual:
python -m admin_panel.create_admin <username> <password>
uvicorn admin_panel.server:app --host 127.0.0.1 --port 8002Click to expand
The backend provides infrastructure for a native Android management application.
- 🔑 Secure long-lived administrator token (PAT)
- 🧩 Server-Driven UI
- 🔔 Firebase Cloud Messaging (FCM) push notifications
- 📋 Orders, tickets, users, products, discounts, VPN panels and web admins
- 🌍 Server map through WebView
- 🎨 Light/dark interface
- 🔕 Per-section notification controls
Click to expand
| Panel | Status | Notes |
|---|---|---|
| PasarGuard | ✅ Full | Automatic provisioning |
| Marzban | ✅ Full | Automatic provisioning |
| Marzneshin | ✅ Full | Service-based provisioning |
| Hiddify | ✅ Full | API-key based |
| 3X-UI | ✅ Full | Bearer API token |
| Alireza X-UI | ✅ Full | Cookie-based login |
| Rebecca | ✅ Full | Marzban-based provider |
| S-UI | ✅ Full | Token-based API |
| WGDashboard | ✅ Full | Configuration-based |
| MikroTik / User Manager | Profile-based | |
| IBSng | Admin-panel integration | |
| Other panels | ➕ Extensible | Add a provider |
- 🐧 Ubuntu 20.04+ / Debian 11+ recommended
- 🐍 Python 3.10+
- 🖥️ Linux VPS/server with a stable public IP
- 🤖 Telegram bot token
- 🌐 Public HTTPS domain for Mini App/web panel/webhook features
- 🔑 API credentials for the payment/VPN providers you enable
🔒 Never publish bot tokens,
.envfiles, API keys or production secrets.
Recommended: on a fresh Ubuntu/Debian server, run:
bash <(curl -fsSL https://raw.githubusercontent.com/mehdirafatpanah/Shopvpn/main/manage.sh)What does the installer do?
- Installs system prerequisites
- Clones or updates the project
- Creates the Python virtual environment
- Installs required packages
- Installs/updates the local translation runtime and language models automatically
- Creates/configures
.env - Creates the systemd service
- Starts the bot and keeps it running after server reboots
sudo systemctl status v2raybot
sudo journalctl -u v2raybot -f
sudo systemctl restart v2raybot
sudo systemctl stop v2raybotThe same one-line installer can be run again for future updates. Translation runtime and language models are installed/updated automatically; no manual translation setup is required.
Click to expand
git clone https://github.com/mehdirafatpanah/Shopvpn.git
cd Shopvpnpython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtcp .env.example .env
nano .envAt minimum:
BOT_TOKEN=your_bot_token
OWNER_ID=your_numeric_telegram_idpython main.pyFor production, use the automatic installer/systemd approach or another process manager.
Click to expand
The exact variables depend on enabled features. Common configuration areas include:
| Area | Examples |
|---|---|
| Telegram | BOT_TOKEN, OWNER_ID |
| Database | database/storage paths |
| Web | domain, authentication, webhook settings |
| Payments | gateway API keys |
| VPN Panels | URLs, credentials, tokens, IDs |
| AI | provider API keys |
| Backups | destinations and SFTP credentials |
| Android | FCM credentials |
Keep production secrets outside the repository.
Click to expand
manage.sh is the main installation and maintenance helper.
Depending on the project version, it can handle:
- 🚀 Installation and dependency setup
- ⚙️ Environment/configuration
▶️ Start/stop/restart- 📲 Mini App and web panel setup
- 🗄️ Backup/restore
- 🔌 VPN panel setup
- 📋 Logs and diagnostics
- 🔗 Integration API setup
- 🌐 Persian/English management menu
Run:
chmod +x manage.sh
./manage.shThe script itself is the authoritative source for the current menu options.
Click to expand
Shopvpn/
├── server.py
├── bot_manager.py
├── handlers_admin.py
├── payment_*.py
├── ai_support.py
├── db/
├── miniapp/
│ ├── server.py
│ └── static/
├── admin_panel/
│ ├── server.py
│ └── static/
├── manage.sh
├── requirements*.txt
├── VERSION
├── README.md
└── README.fa.md
Click to expand
- Python 3.10+
- aiogram 3.x
- FastAPI
- SQLite
- HTML/CSS/JavaScript
- Telegram Mini Apps / WebApp authentication
- Firebase Cloud Messaging
- HTTP/API integrations for VPN panels, payments and AI providers
Click to expand
- 🩺 VPN panel health monitoring
- 📊 Advanced sales and activity analytics
- 📣 Topic-based reporting
- 🎁 Bulk gifts
- 🧹 Expired-service cleanup
- 🔌 Token-scoped Integration API
- ⏸️ On-hold services
- 📦 Panel capacity limits
- 📍 Service migration
- 💰 Bulk price editing with undo
- 💸 Cashback
- 🎁 Wallet gift codes
- 🪙 Coins and lottery
- ⭐ Order/service ratings
- 💸 Wallet transfers
- 🧾 Wallet transaction ledger
- 📦 Configurable delivery modes and QR backgrounds
- 🔗 Multi-domain subscription links
- 🧩 Custom configuration-builder products
- 🛠️ 3X-UI utilities
- 🗄️ Multi-bot backup/restore
- 📨 Secondary backup destinations
- 🏭 Owner-only factory reset
- ⏰ Scheduled broadcasts
- 🔘 Automatic Mini App menu-button synchronization
- 🔗 Advertising/deep-link tracking
- 🟢 Admin-presence routing
- 🔔 Pending-invoice push notifications
- 🖼️ Mini App banner/catalog management
- 🔀 Multi-level referral commissions and fraud suspension
- 💳 Reseller postpaid credit
- 📉 Reseller-tier quantity discounts
- 🌐 Resellers without their own Telegram bot through the web API
Click to expand
Bug reports, feature suggestions, documentation improvements and pull requests are welcome.
Before opening a pull request:
- Keep secrets and production credentials out of the repository.
- Preserve database compatibility where possible.
- Run relevant Python/JavaScript checks.
- Keep Persian and English user-facing text synchronized through the i18n layer.
This project is released under the MIT License.
Created by Mehdi Rafatpanah
- Telegram: @celenor
- GitHub: @mehdirafatpanah
- 🇬🇧 English:
README.md - 🇮🇷 Persian:
README.fa.md - 🇷🇺 Russian:
README.ru.md - 🇨🇳 Chinese:
README.zh.md
The application supports multiple UI languages with persisted user language selection and automatic RTL/LTR switching. Additional languages (Vietnamese, Urdu, Kazakh, Uzbek, Turkmen, Belarusian and more) can be activated from the admin panel's language manager, which auto-generates the in-app translations; matching README translations can be added the same way on request.