await

inline suspend fun <T : Event> EventWaiter.await(noinline filter: (T) -> Boolean = { true }): T(source)

Suspends until an event of type T satisfying the filter is received on any shard, then returns it.

If you wish to use a timeout with it, you can use withTimeoutOrNull.

Parameters

filter

Condition to satisfy before returning the event


suspend fun <T : Event> EventWaiterBuilder<T>.await(): T(source)

Suspends until the event waiter receives an event of the specified type, and all preconditions have passed.

Return

The event specified in EventWaiter.of

Throws

If you the timeout was reached