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

io.github.freya022.botcommands.api.commands.application.builder.ApplicationCommandBuilder.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.18
Show newest version
package io.github.freya022.botcommands.api.commands.application.builder

import io.github.freya022.botcommands.api.commands.application.context.annotations.JDAMessageCommand
import io.github.freya022.botcommands.api.commands.application.context.annotations.JDAUserCommand
import io.github.freya022.botcommands.api.commands.application.slash.ApplicationGeneratedValueSupplier
import io.github.freya022.botcommands.api.commands.application.slash.annotations.JDASlashCommand
import io.github.freya022.botcommands.api.commands.application.slash.builder.mixins.ITopLevelApplicationCommandBuilder
import io.github.freya022.botcommands.api.commands.builder.ExecutableCommandBuilder
import io.github.freya022.botcommands.api.core.BContext
import kotlin.reflect.KFunction

abstract class ApplicationCommandBuilder> internal constructor(
    context: BContext,
    name: String,
    function: KFunction
) : ExecutableCommandBuilder(context, name, function) {
    abstract val topLevelBuilder: ITopLevelApplicationCommandBuilder

    /**
     * Specifies whether the application command is usable in NSFW channels.
* Note: NSFW commands need to be enabled by the user in order to appear in DMs * * **Default:** false * * See the [Age-Restricted Commands FAQ](https://support.discord.com/hc/en-us/articles/10123937946007) for more details. * * @return `true` if the command is restricted to NSFW channels * * @see JDASlashCommand.nsfw * @see JDAUserCommand.nsfw * @see JDAMessageCommand.nsfw */ var nsfw: Boolean = false /** * @param declaredName Name of the declared parameter in the [function] */ fun customOption(declaredName: String) { selfAggregate(declaredName) { customOption(declaredName) } } /** * @param declaredName Name of the declared parameter in the [function] */ fun generatedOption(declaredName: String, generatedValueSupplier: ApplicationGeneratedValueSupplier) { selfAggregate(declaredName) { generatedOption(declaredName, generatedValueSupplier) } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy