import { NextResponse } from 'next/server';
import { getCloseBotClient } from '@/lib/closebot';

export async function GET() {
  try {
    const client = getCloseBotClient();
    if (!client.isConfigured) {
      return NextResponse.json([]);
    }
    const bots = await client.listBots();
    return NextResponse.json(bots);
  } catch (err) {
    console.error('Failed to list CloseBot bots:', err);
    return NextResponse.json([], { status: 200 });
  }
}
