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

add element

This commit is contained in:
scjtqs 2020-08-30 13:25:33 +08:00
parent ca765c7a78
commit 2ea272bddd
2 changed files with 19 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea

View File

@ -161,6 +161,24 @@ func NewUrlShare(url, title, content, image string) *ServiceElement {
SubType: "UrlShare", SubType: "UrlShare",
} }
} }
func NewXmlMsg(template string, ResId int64) *ServiceElement {
if ResId == 0 {
ResId = 2 //默认值2
}
return &ServiceElement{
Id: int32(ResId),
Content: template,
SubType: "xml",
}
}
func NewJsonMsg(template string) *ServiceElement {
return &ServiceElement{
Id: 1,
Content: template,
SubType: "json",
}
}
func (e *TextElement) Type() ElementType { func (e *TextElement) Type() ElementType {
return Text return Text