MCPcopy Index your code
hub / github.com/Jolymmiels/remnawave-telegram-shop

github.com/Jolymmiels/remnawave-telegram-shop @4.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.1.0 ↗ · + Follow
349 symbols 958 edges 41 files 32 documented · 9% updated 38d ago4.1.0 · 2026-05-01★ 3444 open issues

Browse by type

Functions 267 Types & classes 82
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Remnawave Telegram Shop

Stars Forks Issues

Description

A Telegram bot for selling subscriptions with integration to Remnawave (https://remna.st/). This service allows users to purchase and manage subscriptions through Telegram with multiple payment system options.

Admin commands

  • /sync - Poll users from remnawave and synchronize them with the database. Remove all users which not present in remnawave.

Payment Systems

Features

  • Purchase VPN subscriptions with different payment methods (bank cards, cryptocurrency)
  • Multiple subscription plans (1, 3, 6, 12 months)
  • Automated subscription management
  • Subscription Notifications: The bot automatically sends notifications to users 3 days before their subscription expires, helping them avoid service interruption
  • Multi-language support (Russian and English)
  • Selective Squad Assignment: Configure specific squads to assign to users via UUID filtering
  • All telegram message support HTML formatting https://core.telegram.org/bots/api#html-style
  • Healthcheck - bot checking availability of db, panel.

Version Support

Remnawave Bot
1.6 2.3.6
2.0.0 - 2.1.9 3.2.4
2.2.* 3.2.5
2.3.* 3.5.*

API

Web server start on port defined in .env via HEALTH_CHECK_PORT

  • /healthcheck
  • /${TRIBUTE_PAYMENT_URL} - webhook for tribute

Environment Variables

The application requires the following environment variables to be set:

Variable Description
PRICE_1 Price for 1 month
PRICE_3 Price for 3 month
PRICE_6 Price for 6 month
PRICE_12 Price for 12 month
DAYS_IN_MONTH Days in month
DEFAULT_LANGUAGE Default language for bot messages (en or ru). Default: ru
REMNAWAVE_TAG Tag in remnawave
TRIAL_REMNAWAVE_TAG Tag to assign to trial users in Remnawave (optional, if not set, regular REMNAWAVE_TAG will be used)
HEALTH_CHECK_PORT Server port
IS_WEB_APP_LINK If true, then sublink will be showed as webapp..
REMNAWAVE_HEADERS Additional headers for remnawave requests (format: key1:value1;key2:value2). Example: X-Api-Key:your_key;X-Custom:value (optional)
MINI_APP_URL tg WEB APP URL. if empty not be used.
STARS_PRICE_1 Price in Stars for 1 month
STARS_PRICE_3 Price in Stars for 3 month
STARS_PRICE_6 Price in Stars for 6 month
STARS_PRICE_12 Price in Stars for 12 month
REFERRAL_DAYS Refferal days. if 0, then disabled.
TELEGRAM_TOKEN Telegram Bot API token for bot functionality
DATABASE_URL PostgreSQL connection string
POSTGRES_USER PostgreSQL username
POSTGRES_PASSWORD PostgreSQL password
POSTGRES_DB PostgreSQL database name
REMNAWAVE_URL Remnawave API URL
REMNAWAVE_MODE Remnawave mode (remote/local), default is remote. If local set – you can pass http://remnawave:3000 to REMNAWAVE_URL
REMNAWAVE_TOKEN Authentication token for Remnawave API
CRYPTO_PAY_ENABLED Enable/disable CryptoPay payment method (true/false)
CRYPTO_PAY_TOKEN CryptoPay API token
CRYPTO_PAY_URL CryptoPay API URL
YOOKASA_ENABLED Enable/disable YooKassa payment method (true/false)
YOOKASA_SECRET_KEY YooKassa API secret key
YOOKASA_SHOP_ID YooKassa shop identifier
YOOKASA_URL YooKassa API URL
YOOKASA_EMAIL Email address associated with YooKassa account
TRAFFIC_LIMIT Maximum allowed traffic in gb (0 to set unlimited)
TELEGRAM_STARS_ENABLED Enable/disable Telegram Stars payment method (true/false)
REQUIRE_PAID_PURCHASE_FOR_STARS Require successful cryptocurrency or card payment before allowing Telegram Stars (true/false). Default: false
SERVER_STATUS_URL URL to server status page (optional) - if not set, button will not be displayed
SUPPORT_URL URL to support chat or page (optional) - if not set, button will not be displayed
FEEDBACK_URL URL to feedback/reviews page (optional) - if not set, button will not be displayed
CHANNEL_URL URL to Telegram channel (optional) - if not set, button will not be displayed
TOS_URL URL to TOS (optional) - if not set, button will not be displayed
ADMIN_TELEGRAM_ID Admin telegram id
BLOCKED_TELEGRAM_IDS Comma-separated list of Telegram IDs to block from accessing the bot (e.g., "123456789,987654321")
WHITELISTED_TELEGRAM_IDS Comma-separated list of Telegram IDs that bypass all suspicious user checks (e.g., "111111111,222222222,333333333")
TRIAL_TRAFFIC_LIMIT Maximum allowed traffic in gb for trial subscriptions
TRIAL_DAYS Number of days for trial subscriptions. if 0 = disabled.
TRAFFIC_LIMIT_RESET_STRATEGY Traffic limit reset strategy. Allowed values: DAY, WEEK, MONTH, NO_RESET. Default: MONTH.
TRIAL_TRAFFIC_LIMIT_RESET_STRATEGY Traffic limit reset strategy for trial users. Allowed values: DAY, WEEK, MONTH, NO_RESET. Default: MONTH.
TRIAL_INTERNAL_SQUADS Comma-separated list of squad UUIDs to assign to trial users (optional, if not set, regular SQUAD_UUIDS will be used)
TRIAL_EXTERNAL_SQUAD_UUID Single external squad UUID to assign to trial users during creation and updates (optional, if not set, regular EXTERNAL_SQUAD_UUID will be used)
SQUAD_UUIDS Comma-separated list of squad UUIDs to assign to users (e.g., "773db654-a8b2-413a-a50b-75c3536238fd,bc979bdd-f1fa-4d94-8a51-38a0f518a2a2")
EXTERNAL_SQUAD_UUID Single external squad UUID to assign to users during creation and updates (optional, e.g., "773db654-a8b2-413a-a50b-75c3536238fd")
TRIBUTE_WEBHOOK_URL Path for webhook handler. Example: /example (https://www.uuidgenerator.net/version4)
TRIBUTE_API_KEY Api key, which can be obtained via settings in Tribute app.
TRIBUTE_PAYMENT_URL You payment url for Tribute. (Subscription telegram link)
TELEGRAM_PROXY_URL Proxy URL for Telegram Bot API requests (optional, e.g., socks5://host:port or http://host:port)
MOYNALOG_PROXY_URL Proxy URL for Moy Nalog API requests (optional, e.g., socks5://host:port or http://host:port)

User Interface

The bot dynamically creates buttons based on available environment variables:

  • Main buttons for purchasing and connecting to the VPN are always shown
  • Additional buttons for Server Status, Support, Feedback, and Channel are only displayed if their corresponding URL environment variables are set

Automated Notifications

The bot includes a notification system that runs daily at 16:00 UTC to check for expiring subscriptions:

  • Users receive a notification 3 days before their subscription expires
  • The notification includes the exact expiration date and a convenient button to renew the subscription
  • Notifications are sent in the user's preferred language

Squad Configuration

The bot supports selective squad assignment to users:

Internal Squads (SQUAD_UUIDS)

  • Configure specific squad UUIDs in the SQUAD_UUIDS environment variable (comma-separated)
  • If specified, only squads with matching UUIDs will be assigned to new users
  • If no squads match the specified UUIDs or the variable is empty, all available squads will be assigned
  • This feature allows fine-grained control over which connection methods are available to users

External Squad (EXTERNAL_SQUAD_UUID)

  • Configure a single external squad UUID in the EXTERNAL_SQUAD_UUID environment variable
  • When set, this external squad will be included in all user creation and update requests to the Remnawave API
  • The UUID is validated and parsed during application startup; invalid formats will prevent the application from starting
  • Leave empty to disable external squad assignment

Trial Squad Configuration (TRIAL_INTERNAL_SQUADS and TRIAL_EXTERNAL_SQUAD_UUID)

Trial users can be assigned to different squads than regular paying users:

Trial Internal Squads (TRIA

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 141
Method 126
Struct 69
Interface 7
TypeAlias 6

Languages

Go100%

Modules by API surface

internal/config/config.go75 symbols
internal/remnawave/client.go21 symbols
internal/payment/payment.go14 symbols
internal/database/purchase.go14 symbols
internal/translation/translation.go13 symbols
internal/notification/subscription.go13 symbols
internal/database/customer.go13 symbols
internal/yookasa/models.go12 symbols
utils/text_sanitizer.go10 symbols
internal/platega/types.go10 symbols
internal/notification/subscription_test.go10 symbols
utils/text_sanitizer_test.go8 symbols

For agents

$ claude mcp add remnawave-telegram-shop \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page