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-16 06:02:16 +00:00
|
|
|
// 回复规则
|
2025-06-14 06:46:01 +00:00
|
|
|
type Reply struct {
|
2025-06-18 09:51:32 +00:00
|
|
|
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
|
|
|
|
}
|