update
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user