mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
refactor: replace Discord Gateway DO with Interaction Endpoint
This commit is contained in:
27 files changed
+834
-964
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user