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)