This project is a Telegram bot for selling VPN subscriptions. It works with 3X-UI.
Overview β’ Installation guide β’ Bugs and Feature Requests β’ Support the Project
3X-UI-SHOP is a comprehensive solution designed to automate the sale of VPN subscriptions through Telegram.
The bot uses the 3X-UI panel API for client management and supports multiple payment methods, including
Cryptomus, YooKassa, YooMoney, and Telegram Stars.
The bot enables efficient subscription sales with advanced features:
- Server Manager
- Add, remove, disable, and check servers in the pool
- Automatically distribute new clients across servers
- Manage servers without restarting or reconfiguring the bot
Replace a server with another one
- Promocode System
- Create, edit, and delete promocodes
- Promocodes for adding extra subscription time
Promocodes with discounts
- Notifications
- Send messages to a specific user or all users
- Edit the last sent notification
- Format text using HTML
- Preview notifications before sending
- System notifications for the developer and administrators
Referral ProgramView referral statisticsReward users for inviting new members
Trial PeriodProvide free trial subscriptionsConfigure and disable the trial period
- Flexible Payment System
- Change the default currency
- Easily extendable architecture for adding new payment gateways
Add, edit, and delete subscription plans at any timeEnable or disable payment methodsChange the display order of payment options
User EditorView user informationView referral statisticsView payment history and activated promocodesView server informationEdit user subscriptionsBlock or unblock usersQuick access to a user via forwarded messagesPersonal discounts for users
The bot includes a user-friendly admin panel with tools for efficient management. Administrators do not have access to server management.
Server Manager
: Add, remove, disable, and check servers in the poolBot Statistics
: View usage analytics and performance dataUser Editor
: Manage user accounts and subscriptionsPromocode Editor
: Create, edit, and delete promocodesNotification Sender
: Send custom notifications to usersDatabase Backup
: Create and send database backupsMaintenance Mode
: Disable user access during updates or fixes
- Cryptomus payment
- Trial period
- Referral system
- Statistics
- User editor
- Plans editor
Before starting the installation, make sure you have the installed Docker
-
Install & Upgrade:
bash <(curl -Ls https://raw.githubusercontent.com/snoups/3xui-shop/main/scripts/install.sh) -q cd 3xui-shop
-
Set up environment variables and plans:
-
Copy plans.example.json to plans.json and .env.example to .env:
cp plans.example.json plans.json cp .env.example .env
Update plans.json file with your subscription plans. (Subscription Plans Configuration)
Update .env file with your configuration. (Environment Variables Configuration)
-
Build the Docker image:
docker compose build
-
Run the Docker container::
docker compose up -d
Variable | Required | Default | Description |
---|---|---|---|
LETSENCRYPT_EMAIL | π΄ | - | Email for generating certificates |
BOT_TOKEN | π΄ | - | Telegram bot token |
BOT_ADMINS | β | - | List of admin IDs (e.g., 123456789,987654321) |
BOT_DEV_ID | π΄ | - | ID of the bot developer |
BOT_SUPPORT_ID | π΄ | - | ID of the support person |
BOT_DOMAIN | π΄ | - | Domain of the bot (e.g., 3xui-shop.com) |
BOT_PORT | β | 8080 | Port of the bot |
SHOP_EMAIL | β | [email protected] | Email for receipts |
SHOP_CURRENCY | β | RUB | Currency for buttons (e.g., RUB, USD, XTR) |
β | |||
β | |||
SHOP_PAYMENT_STARS_ENABLED | β | True | Enable Telegram stars payment |
β | |||
SHOP_PAYMENT_YOOKASSA_ENABLED | β | False | Enable Yookassa payment |
SHOP_PAYMENT_YOOMONEY_ENABLED | β | False | Enable Yoomoney payment |
XUI_USERNAME | π΄ | - | Username for authentication in the 3X-UI panel |
XUI_PASSWORD | π΄ | - | Password for authentication in the 3X-UI panel |
XUI_TOKEN | β | - | Token for authentication (if configured in the panel) |
XUI_SUBSCRIPTION_PORT | β | 2096 | Port for subscription |
XUI_SUBSCRIPTION_PATH | β | /user/ | Path for subscription |
YOOKASSA_TOKEN | β | - | Token for YooKassa payment |
YOOKASSA_SHOP_ID | β | - | Shop ID for YooKassa payment |
YOOMONEY_WALLET_ID | β | - | Wallet ID for Yoomoney payment |
YOOMONEY_NOTIFICATION_SECRET | β | - | Notification secret key for Yoomoney payment |
REDIS_HOST | β | 3xui-shop-redis | Host of the Redis server |
REDIS_PORT | β | 6379 | Port of the Redis server |
REDIS_DB_NAME | β | 0 | Name of the Redis database |
REDIS_USERNAME | β | - | Username for authentication in the Redis server |
REDIS_PASSWORD | β | - | Password for authentication in the Redis server |
LOG_LEVEL | β | DEBUG | Log level (e.g., INFO, DEBUG) |
LOG_FORMAT | β | %(asctime)s | %(name)s | %(levelname)s | %(message)s | Log format |
LOG_ARCHIVE_FORMAT | β | zip | Log archive format (e.g., zip, gz) |
{
"durations": [30, 60, 180, 365], // Available subscription durations in days
"plans":
[
{
"devices": 1, // Number of devices supported by the plan
"prices": {
"RUB": { // Prices for Russian rubles (RUB)
"30": 70, // Price for 30 days
"60": 120, // Price for 60 days
"180": 300, // Price for 180 days
"365": 600 // Price for 365 days
},
"USD": { // Prices for US dollars (USD)
"30": 0.7, // Price for 30 days
"60": 1.2, // Price for 60 days
"180": 3, // Price for 180 days
"365": 6 // Price for 365 days
},
"XTR": { // Prices for Telegram stars (XTR)
"30": 60, // Price for 30 days
"60": 100, // Price for 60 days
"180": 250, // Price for 180 days
"365": 500 // Price for 365 days
}
}
},
{
// Next plan
}
]
}
-
Webhook Setup:
- Visit the HTTP Notifications page.
- Enter the botβs domain in the notification URL, ending with
/yookassa
(e.g.,https://3xui-shop.com/yookassa
). - Select the following events:
payment.succeeded
payment.waiting_for_capture
payment.canceled
-
Environment Variables Setup:
- Set the following environment variables:
YOOKASSA_TOKEN
: Your secret keyYOOKASSA_SHOP_ID
: Your shop ID
- Set the following environment variables:
-
Webhook Setup:
- Visit the HTTP Notifications page.
- Enter the botβs domain in the notification URL, ending with
/yoomoney
(e.g.,https://3xui-shop.com/yoomoney
). - Copy the notification secret key.
- Check the box for
sending HTTP-notifications
. - Save the changes.
-
Environment Variables Setup:
- Set the following environment variables:
YOOMONEY_WALLET_ID
: Your wallet IDYOOMONEY_NOTIFICATION_SECRET
: Your notification secret key
- Set the following environment variables:
To ensure the bot functions correctly, you must configure the 3X-UI panel:
- Set up SSL certificate.
- Set up an Inbound (the first one will be used) for adding clients.
- Enable the subscription service with port
2096
and path/user/
.Donβt forget to specify certificate for the subscription.
- Disabling configuration encryption is recommended.
If you find a bug or have a feature request, please open an issue on the GitHub repository. You're also welcome to contribute to the project by opening a pull request.
A special thanks to the following individuals for their generous support:
- Boto
- @olshevskii-sergey
- Aleksey
- @DmitryKryloff
You can support me via the following methods:
- Bitcoin:
bc1ql53lcaukdv3thxcheh3cmgucwlwkr929gar0cy
- Ethereum:
0xe604a10258d26c085ada79cdea9a84a5b0894b91
- USDT (TRC20):
TUqDQ4mdtVJZC76789kPYBMzaLFQBDdKhE
- TON:
UQDogBlLFgrxkVWvDJn6YniCwrJDro7hbk5AqDMoSzmBQ-KQ
Any support will help me dedicate more time to development and accelerate the project!