I Got Tired of Manually Managing My Paid Telegram Channel, So I Built a Bot
Source: Dev.to
Introduction
Last month I was spending hours every week doing the same boring tasks: checking who paid, generating invite links, and removing people whose subscriptions expired. Classic manual work that screams “automate me.” So I built a Python bot to handle everything automatically.
Problem Statement
Running a paid Telegram channel sounds easy until you actually do it. My daily routine looked like this:
- New payment → manually check → manually create an invite link → send it.
- Subscription expires → manually check a spreadsheet → manually kick the user.
- Payment inquiry → dig through payment history.
Multiplying this by 50+ subscribers turned the channel into a part‑time job I didn’t sign up for.
Solution Overview
A Python bot that automates the entire workflow:
- Payment: Users pay with Telegram Stars → bot verifies → bot sends an invite link.
- Expiration: When a subscription expires, the bot kicks the user.
- Reminders: The bot sends a reminder before a subscription expires.
- Referral system: Referral links grant bonus days to both parties.
- Promo codes: Discount codes can be created for launches, holidays, etc.
The whole thing runs on a $5 VPS and has been hands‑off for weeks.
Bot Architecture
| File | Purpose |
|---|---|
bot.py | Handles messages and payments |
database.py | Stores users, subscriptions, and payments |
config.py | Contains prices, messages, and tokens |
A background task runs every hour to:
- Check for expired subscriptions and kick users.
- Send reminders before expiry.
Implementation Details
- Framework:
aiogram 3– async and lightweight. - Database: SQLite – sufficient for a small‑scale channel.
- Payments: Telegram Stars – built‑in to Telegram, no third‑party processors or KYC required.
Key Features
- Telegram Stars payment – Users buy Stars in the app and pay the bot directly.
- Auto‑invite links – After payment, the bot creates a one‑time invite link that expires after use.
- Auto‑kick – Users are removed automatically when their subscription ends.
- Referral system – Users share a link; both the referrer and the new subscriber receive bonus days.
- Promo codes – Easy creation of discount codes for special occasions.
Results
I spent a weekend building the bot. It now saves several hours each week and runs completely hands‑off. The automation eliminates manual checks, reduces errors, and prevents burnout.
Conclusion
If you’re running a paid Telegram channel and still handling everything manually, stop. Automating the workflow with a bot like this will save time and keep your community running smoothly.
Resources
- Full source code, documentation, and deployment instructions are available.
- Get it here if you want to skip the building part.