io.github.freya022.botcommands.api.commands.application.builder.ApplicationCommandOptionAggregateBuilder.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.api.commands.application.builder
import io.github.freya022.botcommands.api.commands.CommandOptionAggregateBuilder
import io.github.freya022.botcommands.api.commands.annotations.GeneratedOption
import io.github.freya022.botcommands.api.commands.application.slash.ApplicationGeneratedValueSupplier
import io.github.freya022.botcommands.api.localization.annotations.LocalizationBundle
import io.github.freya022.botcommands.api.localization.context.AppLocalizationContext
import io.github.freya022.botcommands.api.parameters.resolvers.ICustomResolver
import io.github.freya022.botcommands.internal.parameters.AggregatorParameter
import kotlin.reflect.KFunction
abstract class ApplicationCommandOptionAggregateBuilder> internal constructor(
aggregatorParameter: AggregatorParameter,
aggregator: KFunction<*>
) : CommandOptionAggregateBuilder(aggregatorParameter, aggregator) {
/**
* Declares a custom option, such as an [AppLocalizationContext] (with [@LocalizationBundle][LocalizationBundle])
* or a service.
*
* Additional types can be added by implementing [ICustomResolver].
*
* @param declaredName Name of the declared parameter in the aggregator
*/
abstract fun customOption(declaredName: String)
/**
* Declares a generated option, the supplier gets called on each command execution.
*
* @param declaredName Name of the declared parameter in the aggregator
*
* @see GeneratedOption @GeneratedOption
*/
abstract fun generatedOption(declaredName: String, generatedValueSupplier: ApplicationGeneratedValueSupplier)
}