🐛 修复AI返回数据为空时会下标越界的BUG

This commit is contained in:
李寻欢 2024-07-05 09:43:34 +08:00
parent d07b3b9456
commit 9e8c3f5e6f

View File

@ -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) utils.SendMessage(m.FromUser, m.GroupUser, "AI似乎抽风了没有告诉我你需要的回答~", 0)
return return
} }