Voice

open class Voice @MiraiInternalApi constructor(    val fileName: String,     val md5: ByteArray,     val fileSize: Long,     val _codec: Int = 0,     _url: String) : PttMessage

已弃用的旧版本语音消息.

Voice 由于有设计缺陷已弃用且可能会在将来版本删除, 请使用 Audio.

迁移指南

Constructors

Link copied to clipboard
fun Voice(    fileName: String,     md5: ByteArray,     fileSize: Long,     _codec: Int = 0,     _url: String)

Types

Link copied to clipboard
object Key : AbstractPolymorphicMessageKey<PttMessage, Voice>

Functions

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

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

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

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun followedBy(tail: Message): MessageChain

thistail 连接.

Link copied to clipboard
open override fun hashCode(): Int
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 连接到这个消息的尾部.

Link copied to clipboard
fun toAudio(): Audio

转换为 2.7 新增的 Audio, 以兼容某些无法迁移的情况.

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

得到包含 mirai 消息元素代码的, 易读的字符串. 如 At(member) + "test" 将转为 "[mirai:at:qqId]test".

Properties

Link copied to clipboard
val _codec: Int = 0
Link copied to clipboard
open override val fileName: String
Link copied to clipboard
open override val fileSize: Long
Link copied to clipboard
open override val md5: ByteArray
Link copied to clipboard
var pttInternalInstance: Any? = null
Link copied to clipboard
open val url: String?

下载链接 HTTP URL.