Skip to content

Commit

Permalink
fix: 退出会话时清理
Browse files Browse the repository at this point in the history
  • Loading branch information
yqchilde committed Mar 3, 2023
1 parent fd55bfc commit 9e70860
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/chatgpt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func init() {
select {
case <-time.After(time.Minute * 5):
msgContext.LoadAndDelete(wxId)
delete(chatRoom, wxId)
ctx.ReplyTextAndAt("😊检测到您已有5分钟不再提问,那我先主动结束会话咯")
return
case <-room.done:
Expand All @@ -126,6 +127,7 @@ func init() {
continue
} else if msg == "结束会话" {
msgContext.LoadAndDelete(wxId)
delete(chatRoom, wxId)
ctx.ReplyTextAndAt("已结束聊天的上下文语境,您可以重新发起提问")
return
} else if msg == "清空会话" {
Expand Down

0 comments on commit 9e70860

Please sign in to comment.