Commit 292388a1 authored by PeratX's avatar PeratX

Add XmlMessageHelper

parent e9614009
...@@ -104,6 +104,29 @@ class XMLMessageBuilder( ...@@ -104,6 +104,29 @@ class XMLMessageBuilder(
} }
} }
@MiraiExperimentalAPI
object XmlMessageHelper {
fun share(u: String, title: String?, content: String?, image: String?) = buildXMLMessage {
templateId = 12345
serviceId = 1
action = "web"
brief = "[分享] " + (title ?: "")
url = u
item {
layout = 2
if (image != null) {
picture(image)
}
if (title != null) {
title(title)
}
if (content != null) {
summary(content)
}
}
}
}
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.TYPE) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.TYPE)
@DslMarker @DslMarker
annotation class XMLDsl annotation class XMLDsl
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment