From 9e8c3f5e6f57699f04382912b6bf65d7f7978fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Fri, 5 Jul 2024 09:43:34 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8DAI=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=BC=9A=E4=B8=8B?= =?UTF-8?q?=E6=A0=87=E8=B6=8A=E7=95=8C=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/plugins/ai.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/plugins/ai.go b/plugin/plugins/ai.go index b409e25d..1edbb02f 100644 --- a/plugin/plugins/ai.go +++ b/plugin/plugins/ai.go @@ -137,7 +137,7 @@ func AI(m *plugin.MessageContext) { } // 返回消息为空 - if resp.Choices[0].Message.Content == "" { + if len(resp.Choices) == 0 || resp.Choices[0].Message.Content == "" { utils.SendMessage(m.FromUser, m.GroupUser, "AI似乎抽风了,没有告诉我你需要的回答~", 0) return }