K
Kord9mo ago
vy

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
gdude9mo ago
I don't see why not?
LustigerLurch
LustigerLurch9mo ago
concurrency issues aside, yes

Did you find this page helpful?