Skip to content

Commit

Permalink
fix: 修复插件chatgpt会话出错后异常退出
Browse files Browse the repository at this point in the history
  • Loading branch information
yqchilde committed Jan 26, 2023
1 parent df530db commit 54ffe5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/chatgpt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ func init() {
answer, err := askChatGPT(question)
if err != nil {
ctx.ReplyTextAndAt("ChatGPT出错了, err: " + err.Error())
return
continue
}
chatCTXMap.Store(ctx.Event.FromUniqueID, question+"\n"+answer)
if r, need := filterReply(answer); need {
answer, err := askChatGPT(question + "\n" + answer + r)
if err != nil {
ctx.ReplyTextAndAt("ChatGPT出错了, err: " + err.Error())
return
continue
}
chatCTXMap.Store(ctx.Event.FromUniqueID, question+"\n"+answer)
ctx.ReplyText(answer)
Expand Down

0 comments on commit 54ffe5c

Please sign in to comment.