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

io.github.freya022.botcommands.api.commands.annotations.VarArgs.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.annotations

import io.github.freya022.botcommands.api.commands.application.slash.annotations.SlashOption
import io.github.freya022.botcommands.api.commands.application.slash.builder.SlashCommandBuilder
import io.github.freya022.botcommands.api.commands.prefixed.annotations.TextOption

/**
 * Generates N command options from the specified [@SlashOption][SlashOption] or [@TextOption][TextOption].
 *
 * The target parameter must be of type [List].
 *
 * You can configure how many arguments are required with [numRequired].
 *
 * **Note:** You are limited to one vararg parameter in text commands.
 *
 * @see SlashCommandBuilder.optionVararg
 * @see SlashCommandBuilder.inlineClassOptionVararg
 */
@Target(AnnotationTarget.VALUE_PARAMETER)
@Retention(AnnotationRetention.RUNTIME)
annotation class VarArgs(
    /**
     * The number of times this option needs to appear, which must be between 1 and {@value CommandData#MAX_OPTIONS}.
     */
    val value: Int,

    /**
     * The number of required options for this vararg.
     */
    val numRequired: Int = 1
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy