
用 Quickchat AI 打造 Telegram 火车延误查询机器人
来源标题:Build a National Rail Bot for Telegram
教程介绍如何构建 Homebound,一个通过 Quickchat AI Agent 在 Telegram 上查询单块出发板的个人火车延误机器人。练习板固定为 2026 年 6 月 2 日,可复现 17:35 滑铁卢至雷丁列车晚点 8 分钟、改由 20 站台 17:43 出发的场景。构建需 Quickchat AI 账户及 AI 额度,以及 Telegram 账户。
以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。
You pasted the tutorial text without a specific request, so I haven't created or run anything. Here's what the article actually specifies, then what I can do with it.
Core spec
- Practice board is frozen at 2026-06-02. First row in
trainServices:std17:35,etd17:43, platform 20, reason = signalling fault near Richmond. BoardgeneratedAt= 16:32 UTC = 17:32 BST. - A train's identity is its booked
std, not itsetd.etdmay be a status string (On time,Delayed) instead of a time. - Read board flags before rows (this is the bug the authors hit):
areServicesAvailable: false→ "departure information unavailable", not "no matching trains"- empty list on an available board → "no matching trains"
platformAvailable: false→ withhold every platform, even if a row has one; say "not announced"isCancelled: true→ say cancelled (row keeps itsstd)filterLocationCancelled: true→ says it will skip Reading, may run elsewhere
- Access gate:
telegram_user_id == <your numeric ID>andtelegram_chat_type == private; both must pass. - Action: one fixed read-only GET to the practice
board.json; the prompt does the matching onstd, so 17:35 and 18:05 hit the same request. - Answer shape: train first →
std+etd/status + board time in Europe/London with date; keep the disruption reason; keep station names and local train times; always label as practice data. Distinct cases: 18:35 has no platform, 18:05 is cancelled with a train fault, Polish reply keeps "London Waterloo"/"Reading" and yields "o 17:43 z peronu 20".
What I can do here
- Scaffold the local kit:
board.jsonmatching the described rows/flags plusboard.pywith--at 17:35selecting onstd. - Write
main-prompt.txtandaction-recipe.mdto the spec above. - Both.
- Just review/edit files you already have.
Caveat: I have no access to the starter kit zip, Quickchat AI, or Telegram from this environment, so account/bot setup and live testing have to happen on your side. Which option do you want?
(原文较长,此处译出前 6000 字,完整内容请点「打开原文」。)
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。
