Creates a Web Standards fetch handler for Next.js App Router, Cloudflare Workers, Hono, Deno, and Bun.
fetch
The Application instance.
Webhook configuration options.
Standard fetch handler function (request: Request) => Promise<Response>.
(request: Request) => Promise<Response>
// app/api/webhook/route.ts (Next.js App Router)import { createFetchWebhook } from "telebot-ts";export const POST = createFetchWebhook(app, { secret_token: process.env.WEBHOOK_SECRET }); Copy
// app/api/webhook/route.ts (Next.js App Router)import { createFetchWebhook } from "telebot-ts";export const POST = createFetchWebhook(app, { secret_token: process.env.WEBHOOK_SECRET });
Creates a Web Standards
fetchhandler for Next.js App Router, Cloudflare Workers, Hono, Deno, and Bun.