on
inline fun <T : Any, E : T> EventSource<T>.on(scope: CoroutineScope = coroutineScope, noinline consumer: suspend E.() -> Unit): Job
Convenience method that will invoke the consumer on every event T created by EventSource.events.
The events are buffered in an unlimited buffer and launched in the supplied scope, which is LavaKord by default. Each event will be launched inside the scope separately and any thrown Throwable will be caught and logged.
The returned Job is a reference to the created coroutine, call Job.cancel to cancel the processing of any further events.
inline fun <T : Event> EventSource<Event>.on(scope: CoroutineScope = coroutineScope, noinline consumer: suspend T.() -> Unit): Job
Listens for a TrackEvent