From 10ea8f0b3bbef933748b365851e47ddf97bc4906 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Thu, 23 Sep 2021 19:15:16 +0800 Subject: [PATCH] update --- core/reply.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/reply.go b/core/reply.go index 5118db8..e4e938f 100644 --- a/core/reply.go +++ b/core/reply.go @@ -138,12 +138,14 @@ 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(data, strings.Split(v[1], ".")[1:]...) } + fmt.Println(g) cptn = strings.Replace(cptn, fmt.Sprintf(`"[%s]"`, v[1]), g, -1) } ptns = append(ptns, cptn) @@ -164,6 +166,7 @@ func InitReplies() { s.Reply(httplib.Get(f).Response()) content = strings.Replace(content, v, "", -1) } + content = strings.Replace(content, `[d]`, ",", -1) s.Reply(content) default: d, _ := ioutil.ReadAll(rsp.Body)