We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e12ec69 commit 8c11f48Copy full SHA for 8c11f48
plugin/thesaurus/chat.go
@@ -84,8 +84,20 @@ func init() {
84
85
engine.OnMessage(zero.OnlyToMe, canmatch(tKIMO)).
86
SetBlock(false).Handle(func(ctx *zero.Ctx) {
87
- r, err := kimoi.Chat(ctx.ExtractPlainText())
88
- if err == nil && r.Confidence > 0.5 && r.Confidence < 0.95 {
+ msg := ctx.ExtractPlainText()
+ r, err := kimoi.Chat(msg)
89
+ if err == nil {
90
+ c := 0
91
+ for r.Confidence < 0.5 && c < 3 {
92
+ r, err = kimoi.Chat(msg)
93
+ if err != nil {
94
+ return
95
+ }
96
+ c++
97
98
+ if r.Confidence < 0.5 {
99
100
101
ctx.Block()
102
ctx.SendChain(message.Text(r.Reply))
103
}
0 commit comments