This commit is contained in:
cdle
2021-09-23 21:42:03 +08:00
parent 728b91de96
commit d650136a5a
2 changed files with 6 additions and 6 deletions
-3
View File
@@ -138,15 +138,12 @@ func InitReplies() {
}
cptn = strings.Replace(cptn, "[i]", fmt.Sprintf(`%d`, i), -1)
for _, v := range regexp.MustCompile(`\[(\?[^\[\]]*)\]`).FindAllStringSubmatch(cptn, -1) {
fmt.Println(v)
g := ""
if v[1] == "?" {
g = string(f)
} else {
g, _ = jsonparser.GetString(f, strings.Split(v[1], ".")[1:]...)
}
fmt.Println(cptn, fmt.Sprintf(`"[%s]"`, v[1]), g)
cptn = strings.Replace(cptn, fmt.Sprintf(`[%s]`, v[1]), g, -1)
}
ptns = append(ptns, cptn)
+6 -3
View File
@@ -45,7 +45,7 @@ func initSys() {
},
{
Rules: []string{"raw ^升级$"},
Cron: "41 * * * *",
Cron: "*/5 * * * *",
Admin: true,
Handle: func(s Sender) interface{} {
s.Reply("开始检查核心更新...", E)
@@ -63,7 +63,7 @@ func initSys() {
s.Reply("核心功能已是最新。", E)
} else {
record(need)
s.Reply("核心功能发现更新。", E)
s.Reply("核心功能发现更新。", E, N)
}
files, _ := ioutil.ReadDir(ExecPath + "/develop")
for _, f := range files {
@@ -77,7 +77,7 @@ func initSys() {
s.Reply("扩展"+f.Name()+"已是最新。", E)
} else {
record(need)
s.Reply("扩展"+f.Name()+"发现更新。", E)
s.Reply("扩展"+f.Name()+"发现更新。", E, N)
}
}
}
@@ -90,6 +90,9 @@ func initSys() {
return err
}
s.Reply("编译程序完毕。", E)
if s.GetImType() == "" {
s.Reply("已自动更新。", E, N)
}
sillyGirl.Set("rebootInfo", fmt.Sprintf("%v %v %v", s.GetImType(), s.GetChatID(), s.GetUserID()))
s.Reply("更新完成,即将重启!", E)
go func() {