import { NextRequest, NextResponse } from "next/server"; import { sendTelegram } from "@/lib/telegram"; export async function POST(req: NextRequest) { const body = await req.json().catch(() => ({})); const chatId = String(body.chatId ?? ""); if (!chatId) return NextResponse.json({ error: "Chat-ID fehlt" }, { status: 400 }); try { await sendTelegram(chatId, "Test-Nachricht vom Gutschein-Tracker: Versand funktioniert."); return NextResponse.json({ ok: true }); } catch (e) { return NextResponse.json({ error: e instanceof Error ? e.message : String(e) }, { status: 500 }); } }