listener

inline fun <T : GenericEvent> JDA.listener(timeout: Duration? = null, crossinline block: suspend CoroutineEventListener.(event: T) -> Unit)(source)

Creates and registers an event listener fired for every event of type T on this shard.

If timeout is null, non-positive or non-finite, the default timeout will be used.

Parameters

timeout

The duration for which this listener's code is allowed to run for.

block

The event consumer


inline fun <T : GenericEvent> ShardManager.listener(timeout: Duration? = null, crossinline block: suspend CoroutineEventListener.(event: T) -> Unit)(source)

Creates and registers an event listener fired for every event of type T on every shard.

If timeout is null, non-positive or non-finite, the default timeout will be used.

Parameters

timeout

The duration for which this listener's code is allowed to run for.

block

The event consumer