Skip to content

This is a Telegram bot for selling VPN subscriptions. It works with 3X-UI.

License

Notifications You must be signed in to change notification settings

snoups/3xui-shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

64 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

3xui-shop

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

GitHub License GitHub Downloads (all assets, all releases) GitHub Release GitHub Issues or Pull Requests

Static Badge Static Badge GitHub Repo stars

πŸ“ Overview

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 Program
    • View referral statistics
    • Reward users for inviting new members
  • Trial Period
    • Provide free trial subscriptions
    • Configure 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 time
    • Enable or disable payment methods
    • Change the display order of payment options
  • User Editor
    • View user information
    • View referral statistics
    • View payment history and activated promocodes
    • View server information
    • Edit user subscriptions
    • Block or unblock users
    • Quick access to a user via forwarded messages
    • Personal discounts for users

βš™οΈ Admin Panel

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 pool
  • Bot Statistics: View usage analytics and performance data
  • User Editor: Manage user accounts and subscriptions
  • Promocode Editor: Create, edit, and delete promocodes
  • Notification Sender: Send custom notifications to users
  • Database Backup: Create and send database backups
  • Maintenance Mode: Disable user access during updates or fixes

🚧 Current Tasks

  • Cryptomus payment
  • Trial period
  • Referral system
  • Statistics
  • User editor
  • Plans editor

πŸ› οΈ Installation guide

Dependencies

Before starting the installation, make sure you have the installed Docker

Docker Installation

  1. Install & Upgrade:

    bash <(curl -Ls https://raw.githubusercontent.com/snoups/3xui-shop/main/scripts/install.sh) -q
    cd 3xui-shop
  2. Set up environment variables and plans:

  1. Build the Docker image:

    docker compose build
  2. Run the Docker container::

    docker compose up -d

Environment Variables Configuration

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_TRIAL_ENABLED β­• True Enable trial subscription
SHOP_TRIAL_PERIOD β­• 3 Period of the trial subscription in days
SHOP_PAYMENT_STARS_ENABLED β­• True Enable Telegram stars payment
SHOP_PAYMENT_CRYPTOMUS_ENABLED β­• False Enable Cryptomus 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)

Subscription Plans Configuration

{
    "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
        }
    ]
}

YooKassa Configuration

  1. 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
  2. Environment Variables Setup:

    • Set the following environment variables:
      • YOOKASSA_TOKEN: Your secret key
      • YOOKASSA_SHOP_ID: Your shop ID

YooMoney Configuration

  1. 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.
  2. Environment Variables Setup:

    • Set the following environment variables:
      • YOOMONEY_WALLET_ID: Your wallet ID
      • YOOMONEY_NOTIFICATION_SECRET: Your notification secret key

3X-UI Configuration

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.

πŸ› Bugs and Feature Requests

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.

πŸ’Έ Support the Project

A special thanks to the following individuals for their generous support:

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!