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

package io.github.freya022.botcommands.api.commands.application.builder

import io.github.freya022.botcommands.api.commands.application.ApplicationCommandFilter
import io.github.freya022.botcommands.api.commands.application.ApplicationCommandRejectionHandler
import io.github.freya022.botcommands.api.commands.application.options.builder.ApplicationCommandOptionAggregateBuilder
import io.github.freya022.botcommands.api.commands.application.options.builder.ApplicationOptionRegistry
import io.github.freya022.botcommands.api.commands.builder.ExecutableCommandBuilder
import io.github.freya022.botcommands.api.core.service.getService

interface ApplicationCommandBuilder : ExecutableCommandBuilder,
                                         ApplicationOptionRegistry where T : ApplicationCommandOptionAggregateBuilder {

    //TODO document
    val topLevelBuilder: TopLevelApplicationCommandBuilder

    /**
     * Set of filters preventing this command from executing.
     *
     * @see ApplicationCommandFilter
     * @see ApplicationCommandRejectionHandler
     */
    val filters: MutableList>
}

/**
 * Convenience extension to load an [ApplicationCommandFilter] service.
 *
 * Typically used as `filters += filter()`
 */
inline fun > ApplicationCommandBuilder<*>.filter(): T {
    return context.getService()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy