MusicShare

data class MusicShare(kind: MusicKind, title: String, summary: String, jumpUrl: String, pictureUrl: String, musicUrl: String, brief: String) : MessageContent, ConstrainSingle, CodableMessage

QQ 互联通道音乐分享.

构造实例即可使用.

Since

2.1

Constructors

MusicShare
Link copied to clipboard
fun MusicShare(kind: MusicKind, title: String, summary: String, jumpUrl: String, pictureUrl: String, musicUrl: String)
MusicShare
Link copied to clipboard
fun MusicShare(kind: MusicKind, title: String, summary: String, jumpUrl: String, pictureUrl: String, musicUrl: String, brief: String)

Types

Key
Link copied to clipboard
object Key : AbstractPolymorphicMessageKey<MessageContent, MusicShare>

注意, baseKey MessageContent 不稳定. 未来可能会有变更.

Functions

appendMiraiCodeTo
Link copied to clipboard
open override fun appendMiraiCodeTo(builder: StringBuilder)
contentEquals
Link copied to clipboard
open fun contentEquals(another: String, ignoreCase: Boolean = false): Boolean

判断内容是否与 another 相等.

open fun contentEquals(another: Message, ignoreCase: Boolean = false): Boolean

判断内容是否与 another 相等即 thisanothercontentToString 相等.

open fun contentEquals(another: Message, ignoreCase: Boolean = false, strict: Boolean = false): Boolean

判断内容是否与 another 相等即 thisanothercontentToString 相等. stricttrue 时, 还会额外判断每个消息元素的类型, 顺序和属性. 如 Image 会判断 Image.imageId

contentToString
Link copied to clipboard
open override fun contentToString(): String

转为最接近官方格式的字符串. 如 At(member) + "test" 将转为 "@群名片 test".

followedBy
Link copied to clipboard
open fun followedBy(tail: Message): MessageChain

thistail 连接.

plus
Link copied to clipboard
open operator fun plus(another: Array<out Message>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: CharSequence): MessageChain

another 作为 PlainText 连接到这个消息的尾部.

open operator fun plus(another: String): MessageChain

another 作为 PlainText 连接到这个消息的尾部.

open operator fun plus(another: Iterable<String>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: Iterable<Message>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: Sequence<Message>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: Message): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: MessageChain): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: SingleMessage): MessageChain

another 连接到这个消息的尾部.

serializeToMiraiCode
Link copied to clipboard
open fun serializeToMiraiCode(): String

转换为 mirai 码.

Properties

brief
Link copied to clipboard
val brief: String

在消息列表显示. 例如 "[分享]ファッション"

jumpUrl
Link copied to clipboard
val jumpUrl: String

点击卡片跳转网页 URL. 例如 "http://music.163.com/song/1338728297/?userid=324076307"

key
Link copied to clipboard
open override val key: MessageKey<*>

用于判断是否为同一种元素的 MessageKey. 使用多态类型 MessageKey 最上层的 MessageKey.

kind
Link copied to clipboard
val kind: MusicKind

音乐应用类型

musicUrl
Link copied to clipboard
val musicUrl: String

音乐文件 URL. 例如 "http://music.163.com/song/media/outer/url?id=1338728297&userid=324076307"

pictureUrl
Link copied to clipboard
val pictureUrl: String

消息卡片图片 URL. 例如 "http://p2.music.126.net/y19E5SadGUmSR8SZxkrNtw==/109951163785855539.jpg"

summary
Link copied to clipboard
val summary: String

消息卡片内容. 例如 "rinahamu/Yunomi"

title
Link copied to clipboard
val title: String

消息卡片标题. 例如 "ファッション"