K
Kord4mo 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
gdude4mo ago
I don't see why not?
LustigerLurch
LustigerLurch4mo ago
concurrency issues aside, yes
Want results from more Discord servers?
Add your server