From d96f840d7fd4be39bf19c36d1c915da452c4df07 Mon Sep 17 00:00:00 2001 From: ctaoist <14012127+ctaoist@users.noreply.github.com> Date: Fri, 3 Feb 2023 23:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=96=E5=87=BA=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=97=B6LocalImageElement=E7=BC=BA=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#1884)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coolq/cqcode.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/coolq/cqcode.go b/coolq/cqcode.go index ab73c5f..4258557 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -282,6 +282,18 @@ func toElements(e []message.IMessageElement, source message.Source) (r []cqcode. {K: "type", V: "sticker"}, }, } + case *LocalImageElement: + data := pairs{ + {K: "file", V: o.File}, + {K: "url", V: o.URL}, + } + if o.Flash { + data = append(data, pair{K: "type", V: "flash"}) + } + m = cqcode.Element{ + Type: "image", + Data: data, + } default: continue }