EventProcessor

interface EventProcessor

事件处理器,代表一个事件被触发的入口。

EventProcessor 会通过当前事件中的 bot 所提供的作用域进行事件调度。

Author

ForteScarlet

Functions

Link copied to clipboard
abstract fun isProcessable(eventKey: Event.Key<*>): Boolean

判断是否存在对应的事件监听器。

Link copied to clipboard
abstract suspend fun push(event: Event): EventProcessingResult

推送一个事件到当前事件处理器。

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
inline suspend fun EventProcessor.pushIfProcessable(eventKey: Event.Key<*>, block: () -> Event): EventProcessingResult?

eventKey 在当前事件处理器中能够被处理时( EventProcessor.isProcessable == true ), 通过 block 计算一个目标事件类型。

inline suspend fun <E : Event> EventProcessor.pushIfProcessable(block: () -> E): EventProcessingResult?

E 在当前事件处理器中能够被处理时( EventProcessor.isProcessable == true ), 通过 block 计算一个目标事件类型。