中文文档 | English
A serverless Telegram bot that monitors RSS feeds, X (Twitter) users, and YouTube channels (via RSSHub) and sends notifications to Telegram chats, supergroups, and topics. Run entirely on Cloudflare Workers (Free Tier compatible).
- Serverless: Runs on Cloudflare Workers (no VPS required).
- Interactive Management: Add/remove subscriptions directly from Telegram.
- Topic Support: Fully supports Telegram Supergroup Topics (Threads).
- Multi-Subscription: Monitor multiple feeds.
- Selective Forwarding: Forward notifications to another chat, with option to mute source.
- Cost Efficient: Uses Cloudflare KV for state and Cron Triggers for scheduling.
- Cloudflare Account: Sign up here.
- Telegram Bot Token: Get one from @BotFather.
- GitHub Account: For deployment via GitHub Actions.
-
Create a KV Namespace:
- Go to Cloudflare Dashboard > Workers & Pages > KV.
- Create a namespace named
RSS_BOT_KV. - Copy the ID of the namespace you just created.
-
Update Configuration (Optional for GitHub Actions):
- If using GitHub Actions (Recommended): You can skip this step. The workflow will automatically inject the
KV_IDfrom your repository secrets. - If deploying manually: Open
wrangler.tomland replaceTODO_REPLACE_WITH_YOUR_KV_IDwith your actual KV ID. - (Optional) You can leave
preview_idas is or set it to the same ID for testing.
- If using GitHub Actions (Recommended): You can skip this step. The workflow will automatically inject the
- Fork or push this repository to GitHub.
- Go to Settings > Secrets and variables > Actions.
- Add the following Repository Secrets:
CLOUDFLARE_API_TOKEN: Create via User Profile > API Tokens (Template: Edit Cloudflare Workers).CLOUDFLARE_ACCOUNT_ID: Found on the right sidebar of your Workers dashboard.TELEGRAM_BOT_TOKEN: Your Telegram Bot Token.KV_ID: The ID of yourRSS_BOT_KVnamespace.RSS_BASE_URL: (Optional) Custom RSSHub base URL (defaults tohttps://rsshub.app). Supports host-only or base path (e.g.https://rsshub.apporhttps://your-rsshub.example.com/proxy). Legacy full-route values (like/youtube/user) are auto-normalized.
- Push to the
mainbranch. The Action will automatically deploy your worker.
npm install
npx wrangler deployAfter deployment, configure the secrets in Cloudflare:
- Go to Cloudflare Dashboard > Workers & Pages > Overview > Select
rss-feed-bot. - Go to Settings > Variables and Secrets.
- Add the following secrets:
TELEGRAM_BOT_TOKEN: Your Telegram Bot Token.- (Optional)
RSS_BASE_URL: Defaults tohttps://rsshub.app. Supports host-only or base path. Legacy full-route values (like/youtube/user) are auto-normalized.
For the bot to reply to commands, you must tell Telegram where your Worker is located.
- Find your Worker URL (e.g.,
https://rss-feed-bot.your-subdomain.workers.dev). - Run this command in your browser or terminal:
curl "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook?url=<YOUR_WORKER_URL>"Replace <YOUR_BOT_TOKEN> and <YOUR_WORKER_URL> with your actual values.
Add the bot to your Group or Supergroup.
-
Add Subscription:
/add rss <url> /add x <username> /add youtube <username>Example:
/add rss https://example.com/feed.xml/add x elonmusk/add youtube PewDiePie
-
Remove Subscription:
/del <name> /del <type> <name>Example:
/del elonmusk(remove all subscriptions namedelonmuskin current chat/thread)/del x elonmusk(remove only X subscription)/del youtube elonmusk(remove only YouTube subscription)<type>supportsrss,x,youtube.
-
List Subscriptions:
/listOutput format:
- [type] channel_name(e.g.- [x] elonmusk) -
Forwarding Settings: Configure message forwarding to another channel/group.
/set_forward <target_chat_id> [target_thread_id] [only_forward] [scope]target_thread_id: Optional. Forward to a specific topic/thread in the target group.only_forward: Optional.trueto stop sending to source,falseto keep both.scope: Optional.topic(default) orglobal.topic: Applies only to the current source topic/thread.global: Applies to the entire source chat (all topics).
Example:
/set_forward -100123456789 123 true global(Global forward to target topic 123)/set_forward -100123456789 456 false topic(Topic forward to target topic 456)
To remove:
/del_forward [scope]- Default scope is
topic. Use/del_forward globalto remove global config.
-
Forward Subscriptions (Bulk Copy): Allows copying subscriptions from the current chat to another chat.
/forward_to <target_chat_id> [target_thread_id] -
Get Chat Info:
/idReturns the current Chat ID and Thread ID.
-
Help:
/help
- Interactive: When you send a command, Telegram pushes the update to the Worker (Webhook), which updates the subscription list in KV.
- Scheduled: Every 15 minutes (configurable in
wrangler.toml), the Worker wakes up, checks RSS feeds for all subscriptions, and sends alerts for new updates.
ISC