forked from lxh/go-wxhelper
🐛 修复AI返回数据为空时会下标越界的BUG
This commit is contained in:
parent
d07b3b9456
commit
9e8c3f5e6f
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user