refactor: replace Discord Gateway DO with Interaction Endpoint

This commit is contained in:
RhenCloud committed 2026-08-03 03:02:42 +08:00
1 parent 9bb9cb1444
commit d540d465d1
27 files changed
+834 -964

No files matched your search

+3
View File
@@ -2,6 +2,7 @@ import { Hono } from "hono";
import type { Env } from "./types";
import { verifySignature, parseEvent } from "./webhook";
import { dispatchEvent } from "./discord";
import { handleInteractionRequest } from "./discord-interactions";
import { createOAuthRoutes } from "./oauth-routes";
import { createActionRoutes } from "./action-routes";
import { createAdminRoutes } from "./admin-routes";
@@ -68,6 +69,8 @@ export function createServer(): Hono<{ Bindings: Env }> {
return c.json({ ok: true });
});
app.post("/discord/interactions", (c) => handleInteractionRequest(c.req.raw, c.env));
app.notFound((c) => {
if (c.env.ASSETS) {
return c.env.ASSETS.fetch(c.req.raw);