Voice

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

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

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

迁移指南

Constructors

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

Types

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

Functions

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".

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

thistail 连接.

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

toAudio
Link copied to clipboard
fun toAudio(): Audio

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

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

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

Properties

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

下载链接 HTTP URL.