This commit is contained in:
cdle
2021-09-29 13:05:38 +08:00
parent 733f6a2d36
commit a4dd066dc6
+1 -1
View File
@@ -110,10 +110,10 @@ func init() {
rt, err := vm.Run(template + `
""
`)
result := rt.String()
if err != nil {
return err
}
result := rt.String()
for _, v := range regexp.MustCompile(`\[image:\s*([^\s\[\]]+)\s*\]`).FindAllStringSubmatch(result, -1) {
s.Reply(ImageUrl(v[1]))
result = strings.Replace(result, fmt.Sprintf(`[image:%s]`, v[1]), "", -1)