mirai-core / net.mamoe.mirai.utils / ExternalImage

ExternalImage

class ExternalImage

外部图片. 图片数据还没有读取到内存.

在 JVM, 请查看 'ExternalImageJvm.kt'

See Also

ExternalImage.sendTo

ExternalImage.upload

Constructors

<init>

ExternalImage(md5: ByteArray, input: ByteReadChannel, inputSize: Long)
ExternalImage(md5: ByteArray, input: Input, inputSize: Long)
ExternalImage(md5: ByteArray, input: ByteReadPacket)
ExternalImage(md5: ByteArray, input: InputStream)

Properties

input

val input: Any

inputSize

val inputSize: Long

md5

val md5: ByteArray

Functions

calculateImageResourceId

fun calculateImageResourceId(): String

toString

fun toString(): String

Companion Object Properties

defaultFormatName

const val defaultFormatName: String

Companion Object Functions

generateImageId

fun generateImageId(md5: ByteArray): String

generateUUID

fun generateUUID(md5: ByteArray): String

Extension Functions

sendTo

将图片作为单独的消息发送给指定联系人

suspend fun <C : Contact> ExternalImage.sendTo(contact: C): MessageReceipt<C>

upload

上传图片并通过图片 ID 构造 Image 这个函数可能需消耗一段时间

suspend fun ExternalImage.upload(contact: Contact): OfflineImage