This commit is contained in:
cdle
2021-10-06 21:02:14 +08:00
parent 6fdab062ab
commit 95f60df9d1
+2 -3
View File
@@ -58,14 +58,13 @@ func init() {
}
core.GroupPushs["tg"] = func(i, j int, s string) {
paths := []string{}
ct := &tb.Chat{ID: int64(i)}
b.Send(ct, s)
for _, v := range regexp.MustCompile(`\[CQ:image,file=([^\[\]]+)\]`).FindAllStringSubmatch(s, -1) {
paths = append(paths, core.ExecPath+"/data/images/"+v[1])
s = strings.Replace(s, fmt.Sprintf(`[CQ:image,file=%s]`, v[1]), "", -1)
}
ct := &tb.Chat{ID: int64(i)}
b.Send(ct, s)
if len(paths) > 0 {
is := []tb.InputMedia{}
for index, path := range paths {