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

FriendImage

sealed class FriendImage : AbstractImage

好友图片

imageId 形如 /f8f1ab55-bf8e-4236-b55e-955848d7069f (37 长度) 或 /000000000-3814297509-BFB7027B9354B8F899A062061D74E206 (54 长度)

Types

Key

companion object Key : Key<FriendImage>

Companion Object Properties

typeName

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

val typeName: String

Extension Properties

md5

val Image.md5: ByteArray

Extension Functions

flash

fun FriendImage.flash(): FriendFlashImage

flash2

fun FriendImage.flash2(): FriendFlashImage

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

OfflineFriendImage

通过 Group.uploadImage 上传得到的 GroupImage. 它的链接需要查询 Bot.queryImageUrl

data class OfflineFriendImage : FriendImage, OfflineImage

OnlineFriendImage

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

abstract class OnlineFriendImage : FriendImage, OnlineImage