This commit is contained in:
cdle
2021-09-20 11:05:14 +08:00
parent 917bc2a24e
commit 3fe87e2c59
+10
View File
@@ -1,5 +1,7 @@
package core
import "regexp"
var Pushs = map[string]func(int, string){}
var GroupPushs = map[string]func(int, int, string){}
@@ -27,3 +29,11 @@ func (ct *Chat) Push(content interface{}) {
}
}
}
func NotifyMasters(class string, content string) {
for _, v := range regexp.MustCompile(`(\d+)`).FindAllStringSubmatch(Bucket(class).Get("masters"), -1) {
if push, ok := Pushs[class]; ok {
push(Int(v[1]), content)
}
}
}