MusicShare

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

QQ 互联通道音乐分享.

构造实例即可使用.

Since

2.1

Constructors

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

Types

Link copied to clipboard

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

Functions

Link copied to clipboard
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 相等.

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

转为接近官方格式的字符串, 即 "内容". 如 At(member) + "test" 将转为 "@QQ test".

Link copied to clipboard

thistail 连接.

Link copied to clipboard

当消息内容为空白时返回 true.

Link copied to clipboard

当消息内容为空时返回 true.

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

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

open operator fun plus(another: CharSequence): MessageChain

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

open operator fun plus(another: String): MessageChain

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

@JvmName(name = "plusIterableString")
open operator fun plus(another: Iterable<String>): MessageChain

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

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

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

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

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

open operator fun plus(another: Message): MessageChain

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

open operator fun plus(another: MessageChain): MessageChain

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

open operator fun plus(another: SingleMessage): MessageChain

创建一个消息链, 将 another 连接到这个消息的尾部. 这不会改变本 Message, 而是会创建新的 MessageChain 实例. 返回的 MessageChain 实例的第一个元素为本 Message, 随后为按顺序的 another 中的元素.

Link copied to clipboard
suspend operator fun Message.plus(another: Flow<Message>): MessageChain

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

Link copied to clipboard

将此消息元素按顺序重复 count 次.

Link copied to clipboard
inline suspend fun <C : Contact> Message.sendTo(contact: C): MessageReceipt<C>

this 发送给指定联系人

Link copied to clipboard

转换为 mirai 码.

Link copied to clipboard

转换得到 mirai 码.

Link copied to clipboard
operator fun Message.times(count: Int): MessageChain

将此消息元素按顺序重复 count 次.

Link copied to clipboard
fun Message.toForwardMessage(sender: User, time: Int = currentTimeSeconds().toInt(), displayStrategy: ForwardMessage.DisplayStrategy = DisplayStrategy): ForwardMessage
fun Message.toForwardMessage(senderId: Long, senderName: String, time: Int = currentTimeSeconds().toInt(), displayStrategy: ForwardMessage.DisplayStrategy = DisplayStrategy): ForwardMessage

转换为 ForwardMessage

Link copied to clipboard
@JvmName(name = "newChain")
fun Message.toMessageChain(): MessageChain

Properties

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard

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

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

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

Link copied to clipboard

音乐应用类型

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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