mirai-core / net.mamoe.mirai.message.data / OnlineImage

OnlineImage

interface OnlineImage : Image

在服务器上的图片. 它可以直接获取下载链接.

一般由 Contact.uploadImage 得到

Types

Key

companion object Key : Key<OnlineImage>

Properties

originUrl

原图下载链接. 包含域名

abstract val originUrl: String

Companion Object Properties

typeName

Key 指代的 Message 类型名. 一般为 class.simpleName, 如 "QuoteReply", "PlainText"

val typeName: String

Extension Properties

md5

val Image.md5: ByteArray

Extension Functions

flash

fun Image.flash(): FlashImage

flash2

fun Image.flash2(): FlashImage

flatten

扁平化 Message

fun Message.flatten(): Sequence<SingleMessage>

isContentEmpty

判断消息内容是否为空.

fun Message.isContentEmpty(): Boolean

isContentNotEmpty

fun Message.isContentNotEmpty(): Boolean

isNotPlain

fun Message.isNotPlain(): Boolean

isNotPlain2

fun Message.isNotPlain2(): Boolean

isPlain

fun Message.isPlain(): Boolean

isPlain2

fun Message.isPlain2(): Boolean

queryUrl

查询原图下载链接.

suspend fun Image.queryUrl(): String

repeat

fun Message.repeat(count: Int): MessageChain

repeat2

fun Message.repeat2(count: Int): MessageChain

sendTo

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

times

operator fun Message.times(count: Int): MessageChain

toForwardMessage

转换为 ForwardMessage

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

Inheritors

OnlineFriendImage

接收消息时获取到的 FriendImage. 它可以直接获取下载链接 originUrl

abstract class OnlineFriendImage : FriendImage, OnlineImage

OnlineGroupImage

接收消息时获取到的 GroupImage. 它可以直接获取下载链接 originUrl

abstract class OnlineGroupImage : GroupImage, OnlineImage