import type { NextApiRequest, NextApiResponse } from "next";import { db } from "~/server/db";import { Client, ClientMode } from "@buape/carbon"import CommandHandler from "~/server/discord/handler";export async function POST(req: NextApiRequest, res: NextApiResponse) { if (!req.body.data) return res.status(400); const bot = await db.bot.findFirst({ where: { "clientId": req.body.application_id } }) console.log(bot) if (!bot) return res.status(401); const client = new Client({ clientId: bot.clientId, publicKey: bot.publicKey, token: bot.token, mode: ClientMode.Web }, [ new CommandHandler() ]) await client.router.fetch(req.body)}