mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
add element
This commit is contained in:
parent
ca765c7a78
commit
2ea272bddd
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.idea
|
@ -161,6 +161,24 @@ func NewUrlShare(url, title, content, image string) *ServiceElement {
|
||||
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 {
|
||||
return Text
|
||||
|
Loading…
x
Reference in New Issue
Block a user