OnlineAudio
在线语音消息, 即从消息事件中接收到的语音消息.
OnlineAudio 可以获取语音长度以及下载链接.
OnlineAudio 仅可以从事件中的消息链接收, 不可手动构造. 若需要手动构造, 请使用 OfflineAudio.Factory.create 构造 离线语音.
序列化支持
OnlineAudio 支持序列化. 可使用 MessageChain.serializeToJsonString 以及 MessageChain.deserializeFromJsonString. 也可以在 MessageSerializers.serializersModule 获取到 OnlineAudio 的 KSerializer.
要获取更多有关序列化的信息, 参阅 MessageSerializers.
不建议自行实现该接口
OnlineAudio 不稳定, 将来可能会增加新的抽象属性或方法而导致不兼容. 仅可以使用该接口而不能继承或实现它.
Since
2.7
See also
Types
Key
Link copied to clipboard
Functions
contentEquals
Link copied to clipboard
open fun contentEquals(another: String, ignoreCase: Boolean = false): Boolean
Content copied to clipboard
判断内容是否与 another 相等.
open fun contentEquals(another: Message, ignoreCase: Boolean = false): Boolean
Content copied to clipboard
判断内容是否与 another 相等即 this
与 another 的 contentToString 相等.
open fun contentEquals(another: Message, ignoreCase: Boolean = false, strict: Boolean = false): Boolean
Content copied to clipboard
判断内容是否与 another 相等即 this
与 another 的 contentToString 相等. strict 为 true
时, 还会额外判断每个消息元素的类型, 顺序和属性. 如 Image 会判断 Image.imageId
contentToString
Link copied to clipboard
转为最接近官方格式的字符串. 如 At(member) + "test"
将转为 "@群名片 test"
.
followedBy
Link copied to clipboard
将 this
和 tail 连接.
Properties
codec
Link copied to clipboard
filename
Link copied to clipboard
文件名称. 通常为 XXX.amr
. 服务器要求文件名后缀必须为 ".amr", 但其编码方式也有可能是非 AudioCodec.AMR.
urlForDownload
Link copied to clipboard