update
This commit is contained in:
@@ -138,12 +138,14 @@ func InitReplies() {
|
|||||||
}
|
}
|
||||||
cptn = strings.Replace(cptn, "[i]", fmt.Sprintf(`%d`, i), -1)
|
cptn = strings.Replace(cptn, "[i]", fmt.Sprintf(`%d`, i), -1)
|
||||||
for _, v := range regexp.MustCompile(`\[(\?[^\[\]]*)\]`).FindAllStringSubmatch(cptn, -1) {
|
for _, v := range regexp.MustCompile(`\[(\?[^\[\]]*)\]`).FindAllStringSubmatch(cptn, -1) {
|
||||||
|
fmt.Println(v)
|
||||||
g := ""
|
g := ""
|
||||||
if v[1] == "?" {
|
if v[1] == "?" {
|
||||||
g = string(f)
|
g = string(f)
|
||||||
} else {
|
} else {
|
||||||
g, _ = jsonparser.GetString(data, strings.Split(v[1], ".")[1:]...)
|
g, _ = jsonparser.GetString(data, strings.Split(v[1], ".")[1:]...)
|
||||||
}
|
}
|
||||||
|
fmt.Println(g)
|
||||||
cptn = strings.Replace(cptn, fmt.Sprintf(`"[%s]"`, v[1]), g, -1)
|
cptn = strings.Replace(cptn, fmt.Sprintf(`"[%s]"`, v[1]), g, -1)
|
||||||
}
|
}
|
||||||
ptns = append(ptns, cptn)
|
ptns = append(ptns, cptn)
|
||||||
@@ -164,6 +166,7 @@ func InitReplies() {
|
|||||||
s.Reply(httplib.Get(f).Response())
|
s.Reply(httplib.Get(f).Response())
|
||||||
content = strings.Replace(content, v, "", -1)
|
content = strings.Replace(content, v, "", -1)
|
||||||
}
|
}
|
||||||
|
content = strings.Replace(content, `[d]`, ",", -1)
|
||||||
s.Reply(content)
|
s.Reply(content)
|
||||||
default:
|
default:
|
||||||
d, _ := ioutil.ReadAll(rsp.Body)
|
d, _ := ioutil.ReadAll(rsp.Body)
|
||||||
|
|||||||
Reference in New Issue
Block a user