mirror of
https://github.com/tiennm99/claude-status-webhook.git
synced 2026-04-17 15:20:37 +00:00
feat: implement Telegram bot for Claude status webhooks
Cloudflare Workers bot that forwards status.claude.com (Atlassian Statuspage) incident and component updates to subscribed Telegram users via CF Queues fan-out. - Hono.js routing with grammY webhook handler - Bot commands: /start, /stop, /status, /subscribe - Supergroup topic support (message_thread_id) - KV store with claude-status: prefix and composite keys - Queue consumer with batch send, 403 auto-removal, 429 retry - Timing-safe webhook secret validation - HTML escaping for Telegram messages
This commit is contained in:
15
src/index.js
Normal file
15
src/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Hono } from "hono";
|
||||
import { handleTelegramWebhook } from "./bot-commands.js";
|
||||
import { handleStatuspageWebhook } from "./statuspage-webhook.js";
|
||||
import { handleQueue } from "./queue-consumer.js";
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
app.get("/", (c) => c.text("Claude Status Bot is running"));
|
||||
app.post("/webhook/telegram", (c) => handleTelegramWebhook(c));
|
||||
app.post("/webhook/status/:secret", (c) => handleStatuspageWebhook(c));
|
||||
|
||||
export default {
|
||||
fetch: app.fetch,
|
||||
queue: handleQueue,
|
||||
};
|
||||
Reference in New Issue
Block a user