Skip to content

Commit

Permalink
🎨 优化chatgpt reset
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Dec 11, 2022
1 parent 1266b23 commit cd927ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin/ai_reply/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() { // 插件主体
enr := control.Register("aireply", &ctrl.Options[*zero.Ctx]{
DisableOnDefault: false,
Brief: "人工智能回复",
Help: "- @Bot 任意文本(任意一句话回复)\n- 设置回复模式[青云客|小爱|ChatGPT]\n- 设置 ChatGPT SessionToken xxx",
Help: "- @Bot 任意文本(任意一句话回复)\n- 设置回复模式[青云客|小爱|ChatGPT]\n- 设置 ChatGPT SessionToken xxx\n- 重置ChatGPT连接",
PrivateDataFolder: "aireply",
})

Expand Down Expand Up @@ -109,7 +109,11 @@ func init() { // 插件主体
})

enr.OnFullMatch("重置ChatGPT连接").SetBlock(true).Handle(func(ctx *zero.Ctx) {
chats.Reset(ctx.Event.UserID)
err := chats.Reset(ctx.Event.UserID)
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
return
}
ctx.SendChain(message.Text("成功"))
})

Expand Down

0 comments on commit cd927ec

Please sign in to comment.