KookBot
Types
Functions
Link copied to clipboard
abstract fun preProcessor(processor: suspend Signal.Event.(decoder: Json, decoded: () -> Event<*>) -> Unit)
添加一个事件的前置处理器。
Link copied to clipboard
abstract fun processor(processor: suspend Signal.Event.(decoder: Json, decoded: () -> Event<*>) -> Unit)
添加一个事件处理器。所有事件处理器会在每次触发的时候异步的按照添加顺序依次进行处理。
Properties
Extensions
Link copied to clipboard
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 进行事件验证并在验证通过时进行事件处理。
inline fun <EX : Event.Extra, E : Event<EX>> KookBot.processor(eventDefinition: KookEventParserDefinition<EX, E>, crossinline block: suspend (E) -> Unit)
提供一个 KookEventParserDefinition 进行事件验证并在验证通过时进行事件处理。
Link copied to clipboard
inline fun <EX : Event.Extra, E : Event<EX>> KookBot.processorExcludeSelf(eventParser: EventParser<EX, E>, crossinline block: suspend (E) -> Unit)
提供一个 EventParser 进行事件验证并在验证通过时进行事件处理。
inline fun <EX : Event.Extra, E : Event<EX>> KookBot.processorExcludeSelf(eventDefinition: KookEventParserDefinition<EX, E>, crossinline block: suspend (E) -> Unit)
提供一个 KookEventParserDefinition 进行事件验证并在验证通过时进行事件处理。
Link copied to clipboard
通过指定Bot,利用其token和client发起请求并得到对应的ApiResult。
Link copied to clipboard
通过指定Bot,利用其token和client发起请求并得到对应的data响应值。
Link copied to clipboard
通过指定Bot,利用其token和client发起请求并得到对应的data响应值。