nextMessageOrNull
inline suspend fun <P : MessageEvent> P.nextMessageOrNull(timeoutMillis: Long, priority: EventPriority = EventPriority.MONITOR, noinline filter: suspend P.(P) -> Boolean = { true }): MessageChain?
Content copied to clipboard
挂起当前协程, 等待下一条 MessageEvent.sender 和 MessageEvent.subject 与 this 相同且通过 筛选 的 MessageEvent
若 filter 抛出了一个异常, 本函数会立即抛出这个异常.
Return
消息链. 超时时返回 null
See also
Parameters
timeoutMillis
超时. 单位为毫秒.
filter
过滤器. 返回非 null 则代表得到了需要的值. syncFromEvent 会返回这个值