移除tgbot解除绑定,增加候选指令功能

This commit is contained in:
mtvpls
2026-06-30 11:26:41 +08:00
parent c1716615e2
commit 94f4c38575
2 changed files with 36 additions and 11 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ import type { AdminConfig } from '@/lib/admin.types';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig } from '@/lib/config';
import { getStorage } from '@/lib/db';
import { getTelegramConfig, sendTelegramMessage, setTelegramWebhook, TelegramApiError } from '@/lib/telegram';
import { getTelegramConfig, sendTelegramMessage, setTelegramBotCommands, setTelegramWebhook, TelegramApiError } from '@/lib/telegram';
export const runtime = 'nodejs';
@@ -80,6 +80,7 @@ export async function POST(request: NextRequest) {
apiProxy,
apiBaseUrl,
});
await setTelegramBotCommands(botToken, { apiProxy, apiBaseUrl });
return NextResponse.json({ success: true, message: 'Webhook 设置成功', result });
} catch (error) {
if (error instanceof TelegramApiError) {