Skip to content

Telegram Bot Service Overview ​

Updated: 2026-10-16

Telegram Bot is an independent Dujiao-Next extension that extends your site capabilities into Telegram scenarios. It is suitable for sites that need private-domain reach, message notifications, quick entry points, and operational broadcasts.

Note: this page describes the standalone Telegram Bot feature, not the Telegram login settings in system configuration.

1. Pricing and Service Term ​

  • Price: 288USDT / one-time license
  • Service term: one-time license
  • Update support: one-time license with ongoing updates, feature iteration, and version upgrades

2. Suitable Scenarios ​

  • You want to extend user reach from the web to Telegram
  • You want users to browse, order, pay, and receive deliveries without leaving Telegram
  • You need a Bot to handle welcome messages, quick menus, and common entry points
  • You need to send campaign notices, marketing messages, and operational broadcasts to Telegram users
  • You need a dedicated place to review Bot service connectivity, license status, and configuration sync status

3. User-Facing Features (in Telegram) ​

3.1 Home, Help, and Language ​

  • Send /start to open the store home with the cover image, description, welcome message, wallet balance, completed order count, and total spending
  • Send /help to open the help center covering shopping, orders, wallet, and support
  • Supports Simplified Chinese, Traditional Chinese, and English; users pick a language on first visit, it is remembered, and can be switched from the menu at any time

3.2 Browsing and Ordering ​

  • Browse products by category (including subcategories) with pagination, and view specs, prices, and stock
  • Users with a membership level see member prices directly
  • Stock display matches the website: exact count or fuzzy ranges (e.g. 10-50, 100+)
  • Minimum purchase quantity is enforced; products whose stock is below the minimum cannot be ordered
  • Manual-delivery products let users fill in delivery details (custom form) step by step in the Bot, skip optional fields, preview, and submit, with validation (phone, email, number, etc.)

3.3 Payment ​

  • Same payment options as the website: wallet balance or the payment channels allowed in the admin panel; products limited to balance payment only show balance payment
  • QR-based payments (such as Epay and USDT) send the QR code right in the chat; USDT also shows the receiving address and the exact on-chain amount
  • Redirect-based payments provide a pay button, with payment status checks and order cancellation
  • Payment messages are cleaned up automatically after successful payment

3.4 Orders and Delivery ​

  • My Orders: filter by all, pending payment, or completed, and view order details and delivery content
  • Auto-delivery orders push the delivery content after payment; large content (such as many card keys) is sent as a txt file
  • Product delivery usage instructions are shown
  • Manual-delivery orders push the processing result once handled

3.5 Wallet ​

  • View wallet balance and transactions
  • Wallet top-up: choose a preset or custom amount, with optional channel restrictions, and get notified when it arrives
  • Gift card redemption: send a redemption code to credit the balance

3.6 Affiliate ​

  • Enable the affiliate program inside the Bot, get an exclusive invite link, and share it in one tap
  • Orders placed by friends who enter the Bot through the invite link are attributed to the referrer automatically
  • View clicks, valid orders, conversion rate, and pending, withdrawable, and withdrawn commissions
  • View commission and withdrawal records, and request withdrawals directly

3.7 Invite-Code Registration ​

  • When the mall enables invite-code registration, new users must send an invite code on first use to sign up; send /cancel to cancel
  • Users who already have a website account can link Telegram under "Personal Center → Security" on the website and use the Bot without an invite code
  • In invite mode, affiliate attribution is still kept for users who arrive via an affiliate link
  • Affiliate link: https://t.me/<bot_username>?start=aff_<affiliate_code>
  • Invite link: https://t.me/<bot_username>?start=inv_<invite_code>, which fills in the invite code automatically to complete registration

4. Admin Features ​

4.1 Basic Bot Settings ​

  • Enable or disable the Telegram Bot
  • Configure the Bot display name, description, cover image, and support link
  • Configure the default language

4.2 Welcome Message ​

  • Configure welcome messages for new users
  • Maintain welcome copy by language

4.3 Custom Menu ​

  • Configure Bot menu items
  • Set menu text, order, action type, and action value
  • Actions can open a URL, open a Telegram Mini App, or run an in-Bot command
  • Suitable for quick entries such as the homepage, help page, support page, and campaign page

4.4 Connection Status and Runtime Information ​

  • Review Telegram Bot service connectivity
  • Check webhook status, Bot version, configuration version, and last online time
  • Review license status, license expiration time, and warning messages

4.5 Channel Client Management ​

  • Create and manage Telegram Bot channel clients
  • Maintain the Bot Token, callback URL, status switch, and secret reset

4.6 Broadcast Messaging ​

  • Review historical broadcast records
  • Create new broadcast tasks
  • Supported recipients:
    • All Telegram Bot users
    • Selected users
  • Selected users can be filtered by:
    • Nickname
    • Telegram username
    • Telegram User ID
    • Time range
  • Message content supports Telegram HTML format
  • Upload attachments and send them together with the broadcast task
  • Track successful sends, failed sends, completion time, and error messages

5. What Is Included After Purchase ​

  • One-time authorization for the Telegram Bot feature
  • Continuous updates
  • New version iterations and upgrades
  • Compatibility updates for the current mainline version

6. Demo Experience ​

7. Notes ​

  • This service is provided as a one-time license and is suitable for long-term operations
  • If you need to continue customizing business workflows on top of the current Bot, it can be evaluated together with custom development services

8. Deployment and Integration ​

8.1 Preparation ​

  1. In the admin panel, create a Telegram Bot channel client under "Channel Clients", note the Channel Key and Channel Secret, and fill in the Bot Token
  2. Get a license key (see Contact at the end of this page)

8.2 Key config.yml Settings ​

yaml
mall:
  base_url: "http://dujiao-next:8080" # Mall URL, must be reachable from the Bot
  channel_key: ""                     # Channel Key from the admin channel client
  channel_secret: ""                  # Channel Secret from the admin channel client

server:
  listen: ":8444"          # Internal callback server for payment, delivery, and top-up notifications from the mall

telegram:
  bot_token: ""            # Optional; pulled from the admin channel client when empty
  webhook:
    enabled: false         # false = long polling, true = webhook (recommended)
    url: ""                # Public HTTPS webhook URL, e.g. https://bot.example.com/webhook
    listen: ":8443"        # Webhook listen address
    secret_token: ""       # Optional Telegram secret token check

redis:
  host: ""                 # Empty = in-memory mode; user sessions are lost when the Bot restarts

license:
  license_key: ""          # License key
  • mall.base_url, mall.channel_key, mall.channel_secret: required; the key and secret come from the admin channel client
  • Set the channel client's "Callback URL" in the admin panel to the Bot's internal callback server (scheme, host, and port only), e.g. http://dujiao-next-telegram-bot:8444; if the mall cannot reach it, payment, delivery, and top-up notifications cannot be pushed to users
  • Long polling needs no public address and is the quickest way to start; webhook requires an HTTPS domain reverse-proxied to port 8443, and url is required once enabled
  • bot.poll_interval: heartbeat and config sync interval, 30 seconds by default, must be at least 5
  • redis: optional, recommended in production so users do not lose their session on restart

8.3 Docker Deployment: Shared Network ​

When the Bot and the mall run in Docker on the same host, mall.base_url must not be localhost. Use the mall's container or service name, and make sure both are on the same Docker network:

  • In the official Compose file the mall container is named dujiao-next, so use http://dujiao-next:8080
  • Since v1.4.0 the mall ships as a single container and there is no separate -api container; update old addresses such as dujiaonext-api

The Bot's own docker-compose.yml declares no network, so attach it to the mall's network manually:

yaml
services:
  telegram-bot:
    # ...keep the rest of the config unchanged
    networks:
      - dujiao-net

networks:
  dujiao-net:
    external: true
    name: dujiao-next_dujiao-net # The mall's actual network name; check it with the command below

Check which networks the mall container is on:

bash
docker inspect dujiao-next -f '{{range $k,$v := .NetworkSettings.Networks}}{{$k}} {{end}}'

If sharing a network is inconvenient, you can also set mall.base_url to the site's public URL (e.g. https://shop.example.com).

8.4 Common Startup Issues ​

LogCause and Fix
initial config fetch failed ... lookup xxx ... no such host, followed by [FATAL] bot token not availableThe Bot cannot reach the mall (wrong host or not on the same network); the token is not missing. Check mall.base_url and the network as in 8.3; once fixed, initial config fetch failed no longer appears in the logs
[FATAL] bot token not available (without the error above)No Bot Token in the admin channel client and telegram.bot_token is empty; fill in either one
[FATAL] validate config: mall.base_url is requiredmall.base_url is missing; the same applies to channel_key and channel_secret
[FATAL] validate config: license.license_key is requiredThe license key is missing
[FATAL] validate config: telegram.webhook.url is required when webhook is enabledWebhook is enabled without a url; fill it in or switch back to long polling
[FATAL] validate config: bot.poll_interval must be >= 5 secondsSet bot.poll_interval to 5 or higher
[FATAL] load config: ...config.yml is missing or invalid; check the mount path and YAML syntax
[FATAL] prepare license: ...License verification failed: wrong or expired key, or the license server is unreachable; check the key or contact support
[FATAL] license renew fatal: ...License renewal was rejected or the lease expired while running; contact support
[FATAL] create bot: ...Invalid Bot Token or the Telegram API is unreachable; check the token and server network
[FATAL] webhook mode: ...Setting the webhook failed; make sure url is a publicly reachable HTTPS address
[WARN] redis connect failed (fallback to memory)Redis is unreachable and the Bot fell back to in-memory mode; check the redis settings

Contact ​

Released under the GPLv3 License.