io.github.freya022.botcommands.internal.components.builder.PersistentActionableComponentImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of BotCommands Show documentation
Show all versions of BotCommands Show documentation
A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.
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.internal.components.PersistentHandler
internal class PersistentActionableComponentImpl : AbstractActionableComponent(), IPersistentActionableComponent {
override var handler: PersistentHandler? = null
private set
override fun bindTo(handlerName: String, block: ReceiverConsumer) {
this.handler = PersistentHandlerBuilder(handlerName).apply(block).build()
}
}