Package-level declarations

Types

Link copied to clipboard
fun interface CompletedFutureEvent<T : Event>

Functional interface for EventWaiterBuilder.setOnComplete, provides a Future and either the event or an exception.

Link copied to clipboard
@InterfacedService(acceptMultiple = false)
interface EventWaiter

Lets you run code when receiving a specific event, while not blocking threads nor having listeners everywhere, and being able to capture existing variables.

Link copied to clipboard

Builder for EventWaiter

Functions

Link copied to clipboard
suspend fun <T : Event> EventWaiterBuilder<T>.await(): T

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

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

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

Link copied to clipboard
inline suspend fun EventWaiter.awaitMessage(channel: MessageChannel, author: UserSnowflake? = null, crossinline filter: (Message) -> Boolean = { true }): Message

Suspends until a Message from the author satisfying the filter is received on any shard, then returns it.

Link copied to clipboard

Same as EventWaiter.of but with a reified type parameter.