(msg: Api.Message)
| 1378 | } |
| 1379 | |
| 1380 | async function handleModelList(msg: Api.Message): Promise<void> { |
| 1381 | await msg.edit({ text: "🔍 获取可用模型..." }); |
| 1382 | |
| 1383 | try { |
| 1384 | const client = await getGeminiClient(); |
| 1385 | const models = await client.listModels(); |
| 1386 | |
| 1387 | const modelText = `<b>可用模型:</b>\n\n${models.map(model => `• <code>${model}</code>`).join("\n")}`; |
| 1388 | await msg.edit({ text: modelText, parseMode: "html" }); |
| 1389 | } catch (error: any) { |
| 1390 | await msg.edit({ text: Utils.handleError(error, '获取模型') }); |
| 1391 | } |
| 1392 | } |
| 1393 | |
| 1394 | async function handleContextClear(msg: Api.Message): Promise<void> { |
| 1395 | ConfigManager.set(CONFIG_KEYS.GEMINI_CHAT_HISTORY, "[]"); |
no test coverage detected