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

io.github.freya022.botcommands.internal.components.builder.PersistentActionableComponentImpl.kt Maven / Gradle / Ivy

Go to download

A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.

There is a newer version: 3.0.0-alpha.22
Show newest version
package io.github.freya022.botcommands.internal.components.builder

import io.github.freya022.botcommands.api.ReceiverConsumer
import io.github.freya022.botcommands.api.components.builder.IPersistentActionableComponent
import io.github.freya022.botcommands.api.components.builder.PersistentHandlerBuilder
import io.github.freya022.botcommands.api.core.BContext
import io.github.freya022.botcommands.internal.components.handler.PersistentHandler

internal class PersistentActionableComponentImpl> internal constructor(
    context: BContext,
    instanceRetriever: InstanceRetriever
) : AbstractActionableComponent(context, instanceRetriever),
    IPersistentActionableComponent {

    override var handler: PersistentHandler? = null
        private set

    override fun bindTo(handlerName: String, block: ReceiverConsumer): T = instance.also {
        this.handler = PersistentHandlerBuilder(handlerName).apply(block).build()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy