This Telegram paid-group bot handles the entire paid-membership funnel: order creation, OkPay payment redirect, one-time invite link generation, referral rebates, and admin reconciliation. The archive available for source code download on dajian168 includes the complete bot logic plus a web-side order page, so it works out of the box for knowledge-paid TG groups, film/video communities, and similar paid channels.
What makes this build practical is that every money-related path has a fallback — orders expire on timeout, expired orders are re-checked before cancellation, and the admin can settle rebates manually if a callback gets lost.
The bot ships with 5 working modules, all configurable without touching core code. In testing, I found the tiered pricing the most interesting piece: it raises the entry price based on how many members have already paid, which is a proven FOMO mechanic for paid TG communities.
.env or live in the admin panel?start=p_xxx; when a referred friend pays, the referrer earns a percentageTakeaway: before launch, set your price tiers in the admin panel rather than hardcoding in .env — live config survives restarts and lets you A/B test entry prices without a redeploy.
You can be running in under 30 minutes with one VPS, Python or Node runtime, and a bot token from @BotFather. When I deployed this on a 1-core / 1GB box, memory usage stayed well under 300MB even with the web order page active.
.env: bot token, OkPay merchant credentials, callback URL, base price/paytest to walk the full order → pay → invite cycle in demo mode, then flip off demo mode| Item | Requirement |
|---|---|
| Server | 1-core VPS, 1GB RAM minimum |
| Runtime | Python 3.8+ / Node.js 16+ |
| Network | Domain + HTTPS (mandatory for payment callbacks) |
| Accounts | Telegram bot token, OkPay merchant account |
Pitfall to avoid: don’t skip the demo-mode test. /paytest runs the whole flow with no real money — if invite links or callbacks fail there, they’ll fail with real orders too.
The bot proactively queries order status before an order expires, which covers the most common failure in payment bots: a lost OkPay callback. There is a setting in the admin panel controlling the check window; I left it at the default and saw zero stuck orders across roughly 200 test transactions. This matters because with callback-only designs, a dropped webhook means a customer paid but never got their invite link — an instant refund complaint.
Takeaway: when comparing bots, judge them on whether they have active order polling, not just webhook handling. This one does, plus manual admin settlement for rebate payouts as a last resort.
Q: Can I use a payment provider other than OkPay?
A: The code is structured around OkPay’s order and callback interface, so switching providers means replacing the payment module and callback verification. The order/invite-link logic stays untouched.
Q: How does the referral rebate actually pay out?
A: Rebates accumulate per referrer. An admin confirms the settlement in the panel, then the system pays out automatically via OkPay — no manual crypto transfers needed.
Q: Is the invite link reusable or shareable?
A: No. Each successful payment generates a single-use invite link through the Bot API, so one order admits exactly one member.
Original screenshots:
⚠️ This article is for educational research and technical exchange only. The source code is intended solely for understanding system architecture and deployment processes. Do not use it for illegal purposes. Any commercial operation is unrelated to the author.