K
Kord7mo ago
! vyfor

Cancelling the event listener job inside the event listener

Is it possible to cancel the Job returned by Kord#on inside its scope? I doubt it, but would something like this do the trick:
var job: Job? = null
job = kord.on<Event> {
job?.cancel()
}
var job: Job? = null
job = kord.on<Event> {
job?.cancel()
}
2 Replies
gdude
gdude7mo ago
I don't see why not?
LustigerLurch
LustigerLurch6mo ago
concurrency issues aside, yes

Did you find this page helpful?