waitForEvent

Wait for an event to occur, then unregister it on a timeout or when the event occurs once. Useful for listening to chat messages for example.

Parameters

action
the action to run when the even occurs
ignoreCancelled
should it ignore cancelled
predicate
the check that the event must meet
priority
the priority of the listener
timeoutAction
the action if you timout
timeoutTicks
the time to wait for in ticks
inline fun <T : Event> KotlinPlugin.waitForEvent(timeoutTicks: Long, ignoreCancelled: Boolean, priority: EventPriority, crossinline predicate: (T) -> Boolean, crossinline timeoutAction: () -> Unit, crossinline action: (T) -> Unit)