From 9d2b84fd461a22dde86502bbdb1bfd7e65cf2233 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Thu, 23 Sep 2021 11:02:23 +0800 Subject: [PATCH] update --- core/reply.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/reply.go b/core/reply.go index 6af6bf6..0458282 100644 --- a/core/reply.go +++ b/core/reply.go @@ -112,6 +112,13 @@ func InitReplies() { 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) default: d, _ := ioutil.ReadAll(rsp.Body)