18 lines
585 B
TypeScript
18 lines
585 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { ServiceParams } from "./service";
|
|
import { getService } from "./utils";
|
|
|
|
export const getBot = async (
|
|
_req: NextRequest,
|
|
params: ServiceParams,
|
|
): Promise<NextResponse> => getService(params)?.getBot(params);
|
|
|
|
export const sendMessage = async (
|
|
req: NextRequest,
|
|
params: ServiceParams,
|
|
): Promise<NextResponse> => getService(params)?.sendMessage(req, params);
|
|
|
|
export const handleWebhook = async (
|
|
req: NextRequest,
|
|
params: ServiceParams,
|
|
): Promise<NextResponse> => getService(params)?.handleWebhook(req);
|