x
This commit is contained in:
@@ -499,6 +499,7 @@ func (s *BaseSender) Await(message common.Sender, callback func(common.Sender) i
|
||||
c = param
|
||||
}
|
||||
}
|
||||
// c.UserID
|
||||
c.Message = message
|
||||
if len(c.Function.Rules) == 0 {
|
||||
c.Function.Rules = []string{`raw [\s\S]+`}
|
||||
|
||||
+5
-2
@@ -506,14 +506,17 @@ func HandleMessage(sender common.Sender) {
|
||||
return true
|
||||
}
|
||||
} else { //群聊时
|
||||
if u != c.UserID { //群员发言
|
||||
if c.UserID != "" && u != c.UserID { //群员发言
|
||||
if !c.ListenGroup { //未设置允许群员加入拒绝
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { //私聊监听
|
||||
if c.UserID != "" && u != c.UserID { //其他用户
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
for i := range c.Function.Rules {
|
||||
reg, err := regexp.Compile(c.Function.Rules[i])
|
||||
if err != nil {
|
||||
|
||||
+3
-2
@@ -402,10 +402,11 @@ func (sender *SenderJsIplm) Listen(ps ...interface{}) interface{} {
|
||||
}
|
||||
if persistent {
|
||||
options = append(options, "persistent")
|
||||
}
|
||||
if !persistent {
|
||||
} else if len(carry.AllowPlatforms) == 0 {
|
||||
carry.AllowPlatforms = []string{sender.GetPlatform()}
|
||||
}
|
||||
carry.UserID = sender.GetUserID()
|
||||
carry.ChatID = sender.GetChatID()
|
||||
carry.UUID = sender.UUID
|
||||
options = append(options, carry)
|
||||
var newJsSender *SenderJsIplm
|
||||
|
||||
Reference in New Issue
Block a user