This commit is contained in:
cdle
2021-10-14 15:16:50 +08:00
parent 7346720df7
commit 681a9b74f1
2 changed files with 12 additions and 8 deletions
+4 -4
View File
@@ -1,7 +1,6 @@
package core
import (
"regexp"
"strings"
"github.com/beego/beego/v2/adapter/httplib"
@@ -44,14 +43,15 @@ func NotifyMasters(content string) {
if token := sillyGirl.Get("pushplus"); token != "" {
httplib.Get("http://www.pushplus.plus/send?token=" + token + "&title=0101010&content=" + content + "&template=html")
}
for _, class := range []string{"tg", "qq"} {
for _, class := range []string{"tg", "qq", "wx"} {
notify := Bucket(class).Get("notifiers")
if notify == "" {
notify = Bucket(class).Get("masters")
}
for _, v := range regexp.MustCompile(`(\d+)`).FindAllStringSubmatch(notify, -1) {
for _, v := range strings.Split(notify, "&") {
if push, ok := Pushs[class]; ok {
push(Int(v[1]), content)
push(v[1], content)
}
}
}