Package net.mamoe.mirai.message

Types

Link copied to clipboard
open class MessageReceipt<out C : Contact> @MiraiInternalApi constructor(val source: OnlineMessageSource.Outgoing, val target: C)

发送消息后得到的回执. 可用于撤回, 引用回复等.

Link copied to clipboard
interface MessageSerializers

消息序列化器.

Functions

Link copied to clipboard
fun MessageEvent.isContextIdenticalWith(another: MessageEvent): Boolean

判断两个 MessageEvent 的语境, 即 MessageEvent.senderMessageEvent.subject 是否相同

Link copied to clipboard
inline suspend fun <P : MessageEvent> P.nextMessage(    timeoutMillis: Long = -1,     priority: EventPriority = EventPriority.MONITOR,     noinline filter: suspend P.(P) -> Boolean = { true }): MessageChain

挂起当前协程, 等待下一条语境与 this 相同且通过 筛选MessageEvent. 有关语境的定义可查看 isContextIdenticalWith.

inline suspend fun <P : MessageEvent> P.nextMessage(    timeoutMillis: Long = -1,     priority: EventPriority = EventPriority.HIGH,     intercept: Boolean = false,     noinline filter: suspend P.(P) -> Boolean = { true }): MessageChain

挂起当前协程, 等待下一条语境与 this 相同且通过 筛选MessageEvent, 并且拦截该事件. 有关语境的定义可查看 isContextIdenticalWith. 有关拦截的说明可查看 Event.intercept.

Link copied to clipboard
inline fun <P : MessageEvent> P.nextMessageAsync(    timeoutMillis: Long = -1,     coroutineContext: CoroutineContext = EmptyCoroutineContext,     priority: EventPriority = EventPriority.MONITOR,     noinline filter: suspend P.(P) -> Boolean = { true }): Deferred<MessageChain>

nextMessage 的异步版本.

Link copied to clipboard
inline suspend fun <P : MessageEvent> P.nextMessageOrNull(    timeoutMillis: Long,     priority: EventPriority = EventPriority.MONITOR,     noinline filter: suspend P.(P) -> Boolean = { true }): MessageChain?

挂起当前协程, 等待下一条 MessageEvent.senderMessageEvent.subjectthis 相同且通过 筛选MessageEvent

Link copied to clipboard
inline fun <P : MessageEvent> P.nextMessageOrNullAsync(    timeoutMillis: Long,     coroutineContext: CoroutineContext = EmptyCoroutineContext,     priority: EventPriority = EventPriority.MONITOR,     noinline filter: suspend P.(P) -> Boolean = { true }): Deferred<MessageChain?>

nextMessageOrNull 的异步版本.

Properties

Link copied to clipboard
val MessageReceipt<*>.bot: Bot

获取相关 Bot

Link copied to clipboard
val MessageReceipt<*>.sourceIds: IntArray

获取源消息 MessageSource.ids

Link copied to clipboard
val MessageReceipt<*>.sourceInternalIds: IntArray
Link copied to clipboard
val MessageReceipt<*>.sourceMessage: MessageChain
Link copied to clipboard
val MessageReceipt<*>.sourceTime: Int

获取源消息 MessageSource.time