Task
constructor(duration: Duration, callback: suspend () -> Unit, pollingSeconds: Long = 1, coroutineScope: CoroutineScope = dev.kordex.core.utils.getKoin().get<Kord>(), parent: Scheduler? = null, name: String = "Unnamed", repeat: Boolean = false)
Parameters
duration
How long to wait until the callback should be executed.
callback
Callback to execute on task completion.
pollingSeconds
How often to check whether enough time has passed - 1 by default.
coroutineScope
Coroutine scope to launch in - Kord's by default.
parent
Parent Scheduler object, if any.
name
Optional task name, "Unnamed" by default.
repeat
Whether the task should repeat after completion. false by default.