update
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user