← All projects 05 · AUTOPOST-BOT
AUTOPOST-BOT — Telegram RSS + paid subscription
A production Telegram bot with its own payment system and scheduled RSS autoposting. One of 15+ bots I shipped in that stretch.
github.com/dragekorn/AUTOPOST-BOTA platform for monetising Telegram channels: companies pay inside the bot (100 RUB buys 100 tokens for 30 days) to comment in groups where the bot is present. In parallel — RSS autoposting with configurable filters and formatting.
Context
The client needed a self-serve system where companies pay to comment in Telegram channels — no external services, no human account manager. Payments, token accounting, subscription control and moderation all live inside the bot.
What I shipped
- Designed and built a payment system on top of Telegram Payments: 100 tokens for 30 days for 100 RUB, auto-deduct on every comment, auto-revoke after expiry.
- Built an RSS parser with a queue and a schedule: feed import by URL, dedup, auto-formatting of posts for each target channel/group.
- Wrote a comment-control system: the bot instantly deletes posts from users with no active subscription, sends a self-destructing reminder, then a 24-hour ban after 5 ignored warnings.
- Implemented a background file processor — XLSX, JSON and CSV organisation directories are ingested and turned into broadcasts.
- Exposed an admin interface through bot commands: user lookup, manual token grants, unbans, hot-swap of message templates via pm2 --watch.
- Ran it on MongoDB + pm2, pushed secrets to .env, documented the cloning process so the client could spin up new instances.
Technical notes
- Subscription state: hasPaid, tokens, paymentDate, subscriptionEndDate in MongoDB — real financial fields, not a single boolean flag.
- Long-running workers and the file pipeline live in a separate process so they never block the bot’s polling loop.
- Message templates are edited by changing const messageTemplate in index.js — pm2 --watch picks up the change with zero restart.