Contact

expect interface Contact : ContactOrBot, CoroutineScope

联系对象, 即可以与 Bot 互动的对象. 包含 用户, 和 .

actual interface Contact : ContactOrBot

联系对象, 即可以与 Bot 互动的对象. 包含 用户, 和 .

actual interface Contact : ContactOrBot, CoroutineScope

联系对象, 即可以与 Bot 互动的对象. 包含 用户, 和 .

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion

Functions

Link copied to clipboard
@JvmName(name = "getAvatarUrl")
open fun avatarUrl(spec: AvatarSpec): String

头像下载链接.

@JvmName(name = "getAvatarUrl")
open fun avatarUrl(spec: AvatarSpec): String

头像下载链接.

@JvmName(name = "getAvatarUrl")
open fun avatarUrl(spec: AvatarSpec): String

头像下载链接.

Link copied to clipboard
expect open suspend fun sendMessage(message: String): MessageReceipt<Contact>

发送纯文本消息

expect abstract suspend fun sendMessage(message: Message): MessageReceipt<Contact>

向这个对象发送消息.

actual open suspend fun sendMessage(message: String): MessageReceipt<Contact>

发送纯文本消息

actual abstract suspend fun sendMessage(message: Message): MessageReceipt<Contact>

向这个对象发送消息.

actual open suspend fun sendMessage(message: String): MessageReceipt<Contact>

发送纯文本消息

actual abstract suspend fun sendMessage(message: Message): MessageReceipt<Contact>

向这个对象发送消息.

Link copied to clipboard
expect abstract suspend fun uploadImage(resource: ExternalResource): Image

上传一个 资源 作为图片以备发送.

actual abstract suspend fun uploadImage(resource: ExternalResource): Image

上传一个 资源 作为图片以备发送.

actual abstract suspend fun uploadImage(resource: ExternalResource): Image

上传一个 资源 作为图片以备发送.

Properties

Link copied to clipboard
open val avatarUrl: String

头像下载链接, 规格默认为 AvatarSpec.LARGEST

open val avatarUrl: String

头像下载链接, 规格默认为 AvatarSpec.LARGEST

open val avatarUrl: String

头像下载链接, 规格默认为 AvatarSpec.LARGEST

Link copied to clipboard
expect abstract override val bot: Bot

这个联系对象所属 Bot.

actual abstract override val bot: Bot

这个联系对象所属 Bot.

actual abstract override val bot: Bot

这个联系对象所属 Bot.

coroutineContext
Link copied to clipboard
abstract val coroutineContext: CoroutineContext
abstract val coroutineContext: CoroutineContext
Link copied to clipboard
expect abstract override val id: Long

可以是 QQ 号码或者群号码.

actual abstract override val id: Long

可以是 QQ 号码或者群号码.

actual abstract override val id: Long

可以是 QQ 号码或者群号码.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
inline suspend fun Contact.recallMessage(source: MessageChain)
inline suspend fun Contact.recallMessage(source: MessageSource)
Link copied to clipboard
suspend fun Contact.sendNudge(nudge: Nudge): Boolean

发送戳一戳消息.

Link copied to clipboard
expect suspend fun Contact.uploadImage(resource: ExternalResource): Image

将文件作为图片上传, 但不发送

suspend fun Contact.uploadImage(imageStream: InputStream, formatName: String? = null): Image

读取 InputStream 到临时文件并将其作为图片上传, 但不发送

suspend fun Contact.uploadImage(file: File, formatName: String? = null): Image
actual suspend fun Contact.uploadImage(resource: ExternalResource): Image

将文件作为图片上传, 但不发送

actual suspend fun Contact.uploadImage(resource: ExternalResource): Image

将文件作为图片上传, 但不发送