From d650136a5a1e5c1de2ec4d7d1f04a9567a4f67f0 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Thu, 23 Sep 2021 21:42:03 +0800 Subject: [PATCH] update --- core/reply.go | 3 --- core/test.go | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/reply.go b/core/reply.go index f94f19a..259fef8 100644 --- a/core/reply.go +++ b/core/reply.go @@ -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) diff --git a/core/test.go b/core/test.go index 3e3819e..9bfe692 100644 --- a/core/test.go +++ b/core/test.go @@ -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() {