@SinceMirai("0.32.0") abstract class ContactMessage : MessagePacket<User, Contact>, BotEvent
一条消息事件. 它是一个 BotEvent, 因此可以被 监听
支持的消息类型: GroupMessage
See Also
<init> |
一条消息事件. 它是一个 BotEvent, 因此可以被 监听 ContactMessage() |
broadcast |
广播一个事件的唯一途径. suspend fun <E : Event> E.broadcast(): E |
buildForwardMessage |
使用 DSL 构建一个 ForwardMessage. fun ContactMessage.buildForwardMessage(context: Contact = this.subject, displayStrategy: DisplayStrategy = DisplayStrategy, block: ForwardMessageBuilder.() -> Unit): ForwardMessage |
isContextIdenticalWith |
判断两个 MessagePacket 的 MessagePacket.sender 和 MessagePacket.subject 是否相同 fun ContactMessage.isContextIdenticalWith(another: ContactMessage): Boolean fun MessagePacket<*, *>. |
nextMessage |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同且通过 筛选 的 MessagePacket suspend fun <P : ContactMessage> P.nextMessage(timeoutMillis: Long = -1, filter: suspend P.(P) -> Boolean): MessageChain
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同的 MessagePacket suspend fun <P : ContactMessage> P.nextMessage(timeoutMillis: Long = -1): MessageChain |
nextMessageAsync |
fun <P : ContactMessage> P.nextMessageAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<MessageChain> fun <P : ContactMessage> P.nextMessageAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext, filter: suspend P.(P) -> Boolean): Deferred<MessageChain> |
nextMessageContaining |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同的 MessagePacket suspend fun <M : Message> ContactMessage.nextMessageContaining(timeoutMillis: Long = -1): M |
nextMessageContainingAsync |
fun <M : Message> ContactMessage.nextMessageContainingAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<M> |
nextMessageContainingOrNull |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同并含有 M 类型的消息的 MessagePacket suspend fun <M : Message> ContactMessage.nextMessageContainingOrNull(timeoutMillis: Long = -1): M? |
nextMessageContainingOrNullAsync |
fun <M : Message> ContactMessage.nextMessageContainingOrNullAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<M?> |
nextMessageOrNull |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同且通过 筛选 的 MessagePacket suspend fun <P : ContactMessage> P.nextMessageOrNull(timeoutMillis: Long = -1, filter: suspend P.(P) -> Boolean): MessageChain?
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同的 MessagePacket suspend fun <P : ContactMessage> P.nextMessageOrNull(timeoutMillis: Long = -1): MessageChain? |
nextMessageOrNullAsync |
fun <P : ContactMessage> P.nextMessageOrNullAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<MessageChain?> |
selectMessages |
挂起当前协程, 等待任意一个事件监听器触发后返回其返回值. suspend fun <T : ContactMessage, R> T.selectMessages(timeoutMillis: Long = -1, filterContext: Boolean = true, selectBuilder: MessageSelectBuilder<T, R>.() -> Unit): R |
selectMessagesUnit |
selectMessages 的 Unit 返回值捷径 (由于 Kotlin 无法推断 Unit 类型) suspend fun <T : ContactMessage> T.selectMessagesUnit(timeoutMillis: Long = -1, filterContext: Boolean = true, selectBuilder: MessageSelectBuilderUnit<T, Unit>.() -> Unit): Unit |
whileSelectMessages |
挂起当前协程, 等待任意一个事件监听器返回 suspend fun <T : ContactMessage> T.whileSelectMessages(timeoutMillis: Long = -1, filterContext: Boolean = true, selectBuilder: MessageSelectBuilder<T, Boolean>.() -> Unit): Unit |
FriendMessage |
好友消息 class FriendMessage : ContactMessage, BroadcastControllable |
GroupMessage |
class GroupMessage : ContactMessage, Event |
TempMessage |
临时会话消息 class TempMessage : ContactMessage, BroadcastControllable |