fonchain-fiee/pkg/service/asChat/robot/replyAndRuler.go

30 lines
616 B
Go
Raw Normal View History

2025-06-14 06:46:01 +00:00
// Package robot -----------------------------
// @file : replyRuler.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2025/6/13 17:39
// -------------------------------------------
package robot
import (
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/pkg/common/ws"
)
// 回复规则
2025-06-14 06:46:01 +00:00
type Reply struct {
Title string
2025-06-14 06:46:01 +00:00
Response string
2025-06-18 11:47:43 +00:00
Rules []IRobotTask
2025-06-14 06:46:01 +00:00
}
2025-06-18 11:47:43 +00:00
func (r *Reply) Hit(event ws.ListenEventData, robotInfo *accountFiee.ChatUserData) (hit bool, rule IRobotTask) {
for _, rule = range r.Rules {
hit = rule.Hit(event, robotInfo)
2025-06-15 08:01:55 +00:00
if hit {
return
}
}
return
}