This commit is contained in:
cdle
2021-09-23 11:02:23 +08:00
parent 8d03728621
commit 9d2b84fd46
+7
View File
@@ -112,6 +112,13 @@ func InitReplies() {
content = strings.Replace(content, reply.Replace[i][0], "", -1) content = strings.Replace(content, reply.Replace[i][0], "", -1)
} }
} }
for _, re := range regexp.MustCompile(`image[(][^()]+[)]`).FindAllStringSubmatch(content, -1) {
v := re[0]
get := strings.Replace(strings.TrimRight(v, ")"), "image(", "", -1)
f, _ := jsonparser.GetString(data, strings.Split(get, ".")...)
s.Reply(httplib.Get(f).Response())
content = strings.Replace(content, v, "", -1)
}
s.Reply(content) s.Reply(content)
default: default:
d, _ := ioutil.ReadAll(rsp.Body) d, _ := ioutil.ReadAll(rsp.Body)