【模塊 #05】把後台塞進 Telegram 群組:我在手機回一句「OK」,就同時管好 3 個網站[Module #05] Putting My Entire Admin Inside Telegram: Running 3 Websites by Replying "OK" on My Phone
一個人顧多個網站,最累的不是寫程式,而是每天要開好幾個後台審稿。我把整個 SEO Agent 接進 Telegram 群組 Topic,一個網站一個頻道,按一下按鈕就發布上線。
Managing multiple sites gets exhausting when you have to log into separate dashboards. I turned a Telegram Forum Group into my command center—one Topic per site, one tap to publish.
01 // Architecture: One Venture = One Telegram Topic
In traditional development, multi-site management requires a complex SaaS dashboard. Instead, I leverage Telegram's 'Forum Topics' feature within a private group. Each site, like linlink.com or its Singapore counterpart, gets its own dedicated Topic. Architecturally, this means maintaining a single Bot Webhook that routes commands to the correct database and site instance based on the `message_thread_id`. When I launch my 10th site, the system automatically detects it and creates a new Topic via API, enabling seamless horizontal scaling while keeping all metrics and drafts organized on my phone.
02 // Deep Dive: Automation Workflow and Tech Specs
The core of this system is 'Closed-Loop Automation.' It doesn't just post on a schedule; it observes, thinks, and acts. Using Cloudflare Workers Cron Triggers, the system performs data scans during low-traffic hours. It calls data APIs to identify keywords with high impressions but low click-through rates, then tasks the AI to generate content based on these insights. Here is the technical breakdown:
Daily Operational Logic of the Telegram Management System
Phase
System Behavior & Logic
Core Tech Stack
1. Data Inspection
Fetches search data every 24h, calculates trending keywords, and stores them in D1 with priority scoring.
Cloudflare Workers + D1 (SQL)
2. AI Generation
Uses top-weighted keywords to prompt Gemini 1.5 Flash for long-form drafts and structured metadata.
Google Gemini API (Flash)
3. Interactive Report
Bot sends drafts to the specific Topic with Inline Keyboard buttons (Publish, Edit, Regenerate).
Telegram Bot API + Webhooks
4. Command Handling
Clicking 'OK' triggers a webhook to update D1 status to 'Published' and refreshes the frontend.
Cloudflare D1 + Astro SSR
5. Auto-Indexing
Updates the site index list post-publish and notifies search engines to crawl the new content.
Cloudflare Workers + Fetch API
03 // Pitfalls & Optimization: Handling State and Context
The hardest part isn't sending messages; it's state management. When I reply 'Make the second paragraph more professional,' the bot must know which site and draft I'm referring to. I built a state machine using Cloudflare D1, mapping each Telegram `message_id` to a specific `draft_id`. When a webhook receives a reply, it queries the database for context and feeds the previous draft plus my feedback back into the AI. This ensures zero logic confusion even when managing multiple sites simultaneously. For cost efficiency, I use Gemini 1.5 Flash; its speed and price-to-performance ratio for standardized content tasks are unbeatable, with latency under 3 seconds.
04 // Business Logic: Why This Beats WordPress
People ask why I don't just use WordPress with automation plugins. The answer: flexibility and maintenance. Traditional setups increase server load with every new site, and plugin conflicts are a nightmare. This Serverless architecture on Cloudflare runs at near-zero cost and eliminates security risks like brute-force attacks by removing the traditional login dashboard. More importantly, it decouples content production from decision-making. I'm no longer an editor stuck at a desk; I'm an Editor-in-Chief approving quality on my phone. This lightweight, mobile-first model allows a single person to run a multi-site media empire.