processor

inline fun KookBot.processor(eventType: Event.Type, extraType: String, crossinline block: suspend Signal.Event.(decoder: Json, decoded: () -> Any) -> Unit)
inline fun KookBot.processor(eventType: Event.Type, extraType: Event.Type?, crossinline block: suspend Signal.Event.(decoder: Json, decoded: () -> Any) -> Unit)

提供一个事件类型, 并且可选的提供一个extra的子类型,监听这个事件。


inline fun <EX : Event.Extra, E : Event<EX>> KookBot.processor(eventParser: EventParser<EX, E>, crossinline block: suspend (E) -> Unit)

提供一个 EventParser 进行事件验证并在验证通过时进行事件处理。

See also


inline fun <EX : Event.Extra, E : Event<EX>> KookBot.processor(eventDefinition: KookEventParserDefinition<EX, E>, crossinline block: suspend (E) -> Unit)

提供一个 KookEventParserDefinition 进行事件验证并在验证通过时进行事件处理。

See also