1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-04 19:17:37 +08:00

修复取出消息时LocalImageElement缺失问题 (#1884)

This commit is contained in:
ctaoist 2023-02-03 23:59:05 +08:00 committed by GitHub
parent fc0845b16d
commit d96f840d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,6 +282,18 @@ func toElements(e []message.IMessageElement, source message.Source) (r []cqcode.
{K: "type", V: "sticker"}, {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: default:
continue continue
} }