狀態:線上運行中 ── AI 創業家實況 (LINLINK.COM) STATUS: ONLINE ── AI ENTREPRENEUR (LINLINK.COM) 線上運行中 ONLINE
← 返回文章列表 ← Back to Articles
自動化管理工作流 Automation Workflow
MOD #05 · 2026-11-13 · 3 分鐘3 min

【模塊 #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.

📑 顯示/隱藏文章目錄 📑 Show / Hide Table of Contents
  1. 01 // 架構設計:一個事業體 = 一個 Telegram Topic 01 // Architecture: One Venture = One Telegram Topic
  2. 02 // 深度實戰:自動化運作流程與技術細節 02 // Deep Dive: Automation Workflow and Tech Specs
  3. 03 // 踩坑與優化:如何處理「狀態管理」與「對話上下文」? 03 // Pitfalls & Optimization: Handling State and Context
  4. 04 // 商業邏輯:為什麼這比 WordPress 更具競爭力? 04 // Business Logic: Why This Beats WordPress

01 // 架構設計:一個事業體 = 一個 Telegram Topic

在傳統開發思維中,多站點管理通常需要一個複雜的 SaaS 後台。但我選擇利用 Telegram 的「主題分類 (Forum Topics)」功能。我在一個私人的管理群組中開啟此功能,將每個網站對應到一個獨立的 Topic。例如,linlink.com 佔據一個頻道,新加坡站點則在另一個頻道。這在工程上的優勢在於:我只需要維護一個 Bot Webhook,透過判斷 `message_thread_id` 就能精準將指令導向正確的資料庫與網站實例。當我未來新增第 10 個網站時,系統會自動偵測並透過 API 創建新的 Topic,實現完全的橫向擴展,且所有經營數據與草稿在手機上一目了然,互不干擾。

02 // 深度實戰:自動化運作流程與技術細節

這套系統的核心在於「閉環自動化」。它不只是定時發文,而是具備了觀察、思考與執行的能力。我們利用 Cloudflare Workers 的定時觸發機制(Cron Triggers),在每天流量最低的半夜進行數據掃描。系統會調用數據接口,分析哪些關鍵字在搜尋引擎中已有曝光但點擊率尚有提升空間,並以此為基礎讓 AI 生成內容。以下是具體的技術拆解:

Telegram 管理系統的每日運作邏輯
階段系統行為與工程邏輯核心技術棧
1. 數據巡檢每 24 小時抓取搜尋數據,計算熱門潛力詞,並存入 D1 資料庫進行去重與權重排序。Cloudflare Workers + D1 (SQL)
2. AI 內容生成根據權重最高的詞彙,調用 Gemini 1.5 Flash 生成符合品牌語氣的長文草稿與結構化數據。Google Gemini API (Flash)
3. 交互式匯報Bot 將草稿發送至對應 Topic,並附帶 Inline Keyboard 按鈕(發布、修改、重新生成)。Telegram Bot API + Webhooks
4. 即時指令處理當我點擊「OK」,Webhook 接收回調,將 D1 中的草稿狀態改為 Published,並觸發前端渲染。Cloudflare D1 + Astro SSR
5. 自動化索引文章上線後自動更新站點地圖,並通知搜尋引擎進行抓取,完成整個流量獲取閉環。Cloudflare Workers + Fetch API

03 // 踩坑與優化:如何處理「狀態管理」與「對話上下文」?

在開發過程中,最難的不是發送訊息,而是「狀態管理」。當我在 Telegram 回覆「把第二段改得更專業一點」時,Bot 必須知道我是在針對哪一個網站、哪一篇草稿進行對話。我利用 Cloudflare D1 資料庫建立了一個狀態機:每個發送到群組的訊息 ID (`message_id`) 都會與資料庫中的 `draft_id` 綁定。當 Webhook 收到回覆訊息時,它會先去資料庫查詢該訊息所屬的上下文,再將舊草稿與我的修改意見一併餵給 AI 進行迭代。這樣即使我同時在處理三個網站的草稿,邏輯也不會混亂。此外,為了節省成本,我選擇 Gemini 1.5 Flash 而非 Pro,因為在處理標準化的內容生成任務時,Flash 的速度與成本效益比極高,且延遲通常在 3 秒以內。

04 // 商業邏輯:為什麼這比 WordPress 更具競爭力?

很多人問我為什麼不直接用 WordPress 加上自動化外掛?答案是:靈活性與維護成本。傳統架構在處理多站點時,伺服器負載會隨之增加,且外掛之間的衝突常讓人頭痛。這套基於 Cloudflare 的無伺服器(Serverless)架構,幾乎是零月費運行(在免費額度內),且因為沒有傳統的後台登入頁面,從根本上杜絕了暴力破解等安全風險。更重要的是,我將「內容生產」與「決策審核」完全解耦。我不再需要坐在電腦前當編輯,而是像個主編一樣,在手機上透過 Telegram 進行最後的品質把關。這種「輕量化、行動化」的經營模式,讓我一個人就能撐起一個小型媒體矩陣的運作。

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
PhaseSystem Behavior & LogicCore Tech Stack
1. Data InspectionFetches search data every 24h, calculates trending keywords, and stores them in D1 with priority scoring.Cloudflare Workers + D1 (SQL)
2. AI GenerationUses top-weighted keywords to prompt Gemini 1.5 Flash for long-form drafts and structured metadata.Google Gemini API (Flash)
3. Interactive ReportBot sends drafts to the specific Topic with Inline Keyboard buttons (Publish, Edit, Regenerate).Telegram Bot API + Webhooks
4. Command HandlingClicking 'OK' triggers a webhook to update D1 status to 'Published' and refreshes the frontend.Cloudflare D1 + Astro SSR
5. Auto-IndexingUpdates 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.

>_ 快速導航指令台 >_ QUICK COMMAND PALETTE