Compare commits

..

No commits in common. "ebaeac28fb1d087f127ca1bf685c0e04d2083dca" and "fe755bbe13adcbbd3978298ab433ecb821ba00e2" have entirely different histories.

2 changed files with 7 additions and 10 deletions

View File

@ -54,7 +54,7 @@ func ParseToChatUser(c *gin.Context) (chatUserInfo *accountFiee.ChatUserData, co
originId = int64(fieeJwtInfo.ID)
newChatUser = &accountFiee.ChatUserData{
NickName: fieeJwtInfo.NickName,
Account: fieeJwtInfo.Phone,
Account: fieeJwtInfo.Account,
Role: 1,
Origin: config.AppConfig.System.Domain,
OriginId: int64(fieeJwtInfo.ID),

View File

@ -165,12 +165,11 @@ func (r *Robot) Run() {
fmt.Printf("robot listen event:%#v\n", event)
r.mu.Lock()
//加入聊天室规则
hasHit := false
hit := false
for _, rule := range r.joinSessionRules {
hit := rule.Hit(event, r.Info)
hit = rule.Hit(event, r.Info)
fmt.Printf("规则【%s】校验结果:%v\n", rule.GetTitle(), hit)
if hit {
hasHit = true
if rule.RunTime().IsZero() {
err := rule.Run(r.cache)
if err != nil {
@ -181,12 +180,11 @@ func (r *Robot) Run() {
}
}
}
if !hasHit {
if !hit {
for _, rule := range r.keywordsRules {
hit := rule.Hit(event, r.Info)
hit = rule.Hit(event, r.Info)
fmt.Printf("规则【%s】校验结果:%v\n", rule.GetTitle(), hit)
if hit {
hasHit = true
fmt.Println("命中规则:", rule.GetTitle())
if rule.RunTime().IsZero() {
err := rule.Run(r.cache)
@ -199,12 +197,11 @@ func (r *Robot) Run() {
}
}
}
if !hasHit {
if !hit {
for _, rule := range r.noReplyAfterRules {
hit := rule.Hit(event, r.Info)
hit = rule.Hit(event, r.Info)
fmt.Printf("规则【%s】校验结果:%v\n", rule.GetTitle(), hit)
if hit {
hasHit = true
fmt.Println("命中规则:", rule.GetTitle())
if rule.RunTime().IsZero() {
err := rule.Run(r.cache)