All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.freya02.botcommands.internal.components.builder.PersistentTimeoutableComponentImpl.kt Maven / Gradle / Ivy

package com.freya02.botcommands.internal.components.builder

import com.freya02.botcommands.api.components.builder.IPersistentTimeoutableComponent
import com.freya02.botcommands.internal.components.data.PersistentTimeout
import kotlinx.datetime.Clock
import kotlin.time.Duration

internal class PersistentTimeoutableComponentImpl : IPersistentTimeoutableComponent {
    override var timeout: PersistentTimeout? = null
        private set

    override fun timeout(timeout: Duration) {
        this.timeout = PersistentTimeout(Clock.System.now() + timeout, null, emptyArray())
    }

    override fun timeout(timeout: Duration, handlerName: String, vararg data: Any?) {
        this.timeout = PersistentTimeout(Clock.System.now() + timeout, handlerName, data)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy