mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
fix(thesaurus): cnfd. calc.
This commit is contained in:
parent
e12ec697e6
commit
8c11f48502
@ -84,8 +84,20 @@ func init() {
|
|||||||
|
|
||||||
engine.OnMessage(zero.OnlyToMe, canmatch(tKIMO)).
|
engine.OnMessage(zero.OnlyToMe, canmatch(tKIMO)).
|
||||||
SetBlock(false).Handle(func(ctx *zero.Ctx) {
|
SetBlock(false).Handle(func(ctx *zero.Ctx) {
|
||||||
r, err := kimoi.Chat(ctx.ExtractPlainText())
|
msg := ctx.ExtractPlainText()
|
||||||
if err == nil && r.Confidence > 0.5 && r.Confidence < 0.95 {
|
r, err := kimoi.Chat(msg)
|
||||||
|
if err == nil {
|
||||||
|
c := 0
|
||||||
|
for r.Confidence < 0.5 && c < 3 {
|
||||||
|
r, err = kimoi.Chat(msg)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c++
|
||||||
|
}
|
||||||
|
if r.Confidence < 0.5 {
|
||||||
|
return
|
||||||
|
}
|
||||||
ctx.Block()
|
ctx.Block()
|
||||||
ctx.SendChain(message.Text(r.Reply))
|
ctx.SendChain(message.Text(r.Reply))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user