waitFor

inline suspend fun <T : Event> Kord.waitFor(timeout: Long? = null, noinline condition: suspend T.() -> Boolean = { true }): T?
inline suspend fun <T : Event> Kord.waitFor(timeout: Duration? = null, noinline condition: suspend T.() -> Boolean = { true }): T?
@KordPreview
inline suspend fun <T : Event> LiveKordEntity.waitFor(timeout: Long? = null, noinline condition: suspend T.() -> Boolean = { true }): T?
inline suspend fun <T : Event> ExtensibleBot.waitFor(timeout: Duration? = null, noinline condition: suspend T.() -> Boolean = { true }): T?

Return the first received event that matches the condition.

Parameters

T

Event to wait for.

timeout

Time before returning null, if no match can be done. Set to null to disable it.

condition

Function return true if the event object is valid and should be returned.