1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

add NewPrivateReply Helper

This commit is contained in:
sora233 2021-03-25 11:08:24 +08:00
parent d233c90d50
commit 434a4837cb

View File

@ -246,6 +246,15 @@ func NewReply(m *GroupMessage) *ReplyElement {
}
}
func NewPrivateReply(m *PrivateMessage) *ReplyElement {
return &ReplyElement{
ReplySeq: m.Id,
Sender: m.Sender.Uin,
Time: m.Time,
Elements: m.Elements,
}
}
func NewUrlShare(url, title, content, image string) *ServiceElement {
template := fmt.Sprintf(`<?xml version="1.0" encoding="utf-8"?><msg templateID="12345" action="web" brief="[分享] %s" serviceID="1" url="%s"><item layout="2"><picture cover="%v"/><title>%v</title><summary>%v</summary></item><source/></msg>`,
title, url, image, title, content,