A full-featured Telegram bot for managing VPN services through an XUI panel.
This Telegram bot provides a user-friendly interface for managing VPN services. It allows users to create VPN accounts, manage their configurations, check usage statistics, request support, and make payments. Administrators can manage clients, respond to support tickets, and approve payment requests.
- User Management: Create and manage VPN user accounts
- VPN Configuration: Generate, activate, and deactivate VPN configurations
- Free Trial System: Offer limited-time free trials to new users
- Subscription Plans: Various subscription plans with different durations and data limits
- Payment Integration: Process and verify payment requests
- Support Ticketing: In-bot support ticket system for user assistance
- Admin Controls: Comprehensive admin panel for managing users and configurations
- Notification Service: Automated notifications for expiring accounts and other important events
- Usage Statistics: Track and display user bandwidth usage
- Clone this repository
- Install the required dependencies:
pip install python-telegram-bot requests
- Configure the settings in
config.py
Edit the config.py
file to set up your environment:
ADMIN_IDS
: List of Telegram user IDs with admin privilegesBOT_TOKEN
: Your Telegram bot token from BotFatherXUI_URL
: URL of your XUI panelXUI_USERNAME
: XUI panel usernameXUI_PASSWORD
: XUI panel passwordINBOUND_ID
: XUI panel inbound IDIPDOMAIN
: Server IP or domainDOMAIN
: Your service domainPORT
: Service portHOST
&SNI
: Additional connection settings if neededDB_FILE
: Database filenameALLOW_BUY
: Toggle to enable/disable purchase functionality
bot.py
: Main bot application and command handlersclient_management.py
: Functions for managing VPN clientsconfig.py
: Configuration settingsdatabase.py
: Database operations and schemadb_utils.py
: Database utility functionsmenus.py
: Telegram inline keyboard menusnotification_service.py
: Automated notification systemxui_api.py
: API interactions with the XUI panel
-
Start the bot:
python bot.py
-
Access the bot on Telegram and use the available commands:
/start
- Initialize the bot/help
- Show help information- Additional commands as configured in the bot
Administrators have access to additional commands and functionality:
- Manage user accounts
- Process payment requests
- Respond to support tickets
- View system statistics
- Extend client subscriptions
- Access to admin functions is restricted to users with IDs listed in the
ADMIN_IDS
setting - User data is stored in a local SQLite database
- python-telegram-bot
- requests
- sqlite3 (built-in)
This project is proprietary software. All rights reserved.
For support inquiries, contact the administrator through the bot's ticket system or directly through Telegram.