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

com.freya02.botcommands.api.commands.application.slash.builder.SlashSubcommandBuilder.kt Maven / Gradle / Ivy

package com.freya02.botcommands.api.commands.application.slash.builder

import com.freya02.botcommands.api.commands.application.slash.builder.mixins.ITopLevelApplicationCommandBuilder
import com.freya02.botcommands.internal.BContextImpl
import com.freya02.botcommands.internal.commands.application.slash.SlashSubcommandInfo
import com.freya02.botcommands.internal.commands.application.slash.TopLevelSlashCommandInfo
import com.freya02.botcommands.internal.commands.mixins.INamedCommand
import kotlin.reflect.KFunction

class SlashSubcommandBuilder internal constructor(
    context: BContextImpl,
    name: String,
    function: KFunction,
    override val topLevelBuilder: ITopLevelApplicationCommandBuilder,
    override val parentInstance: INamedCommand
) : SlashCommandBuilder(context, name, function) {
    override val allowOptions: Boolean = true
    override val allowSubcommands: Boolean = false
    override val allowSubcommandGroups: Boolean = false

    internal fun build(topLevelInstance: TopLevelSlashCommandInfo, parentInstance: INamedCommand): SlashSubcommandInfo {
        return SlashSubcommandInfo(context, topLevelInstance, parentInstance, this)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy