import { manageActionMsg } from "./actionMsg"; import { manageEventMsg } from "./eventMsg"; export const manageBotReq = async (req: Request) => { const body = (await req.json()) as any; console.log("🚀 ~ manageBotReq ~ body:", body); // 验证机器人 if (body?.type === "url_verification") { return Response.json({ challenge: body?.challenge }); } // 处理Event消息 if (manageEventMsg(body)) return new Response("success"); // 处理Action消息 if (manageActionMsg(body)) return new Response("success"); return new Response("hello, glade to see you!"); };