KookMessageContent

KOOK 中的消息正文类型的抽象接口类型。

在 Kook 中,以接收到的消息事件为例, 一个完整的接收消息所得到 messages 中的元素可能是经过拆解/解析/冗余、扩展的。 如果你希望直接根据真实消息进行复读,则请直接使用 KookReceiveMessageContent 本身作为消息发送的实体而不是获取其中的 messages;同样的原因,如果你需要先对消息进行处理, 请注意消息链中的冗余消息。

DeleteSupport

存在消息ID即可以被删除,因此 KookMessageContent 支持 delete 操作, 不过可能需要考虑权限问题。

Author

ForteScarlet

Inheritors

Properties

Link copied to clipboard
abstract override val id: ID

消息ID。

Link copied to clipboard
abstract override val messages: Messages

KOOK 消息事件中所收到的消息列表。

Link copied to clipboard
abstract val rawContent: String

raw content

Inherited properties

Link copied to clipboard
abstract val plainText: String?

Functions

Link copied to clipboard
abstract suspend override fun delete(vararg options: DeleteOption)

尝试根据当前消息ID删除目标。

Link copied to clipboard
abstract suspend override fun reference(): KookQuote?

获取消息中的引用信息。 会通过 API GetChannelMessageViewApiGetDirectMessageViewApi 发起请求并得到结果, 因此 reference 会产生挂起。

Link copied to clipboard
abstract suspend override fun referenceMessage(): KookMessageContent?

根据 消息引用 查询其对应的消息原内容。