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

io.github.freya022.botcommands.api.commands.annotations.Optional.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.prefixed.annotations.TextOption
import org.jetbrains.annotations.Nullable

/**
 * Marks an option ([@SlashOption][SlashOption] or [@TextOption][TextOption]) as being optional.
 *
 * **Note**: Kotlin users are not required to use this annotation, using `?` is enough.
 *
 * I recommend using [@Nullable][Nullable] annotation instead, to benefit from nullability analysis.
 *
 * **Note for text commands:** Take care with this annotation, you might have errors if your command is considered too complex.
* Several factors can increase the chance of a command being unusable, such as * - Too many optionals * - Options with a dynamic number of spaces (such as strings) * * Attempts at fixing the issue can include moving the parameters around, like avoiding 2 strings next to each other. */ @Target(AnnotationTarget.VALUE_PARAMETER) @Retention(AnnotationRetention.RUNTIME) annotation class Optional




© 2015 - 2024 Weber Informatics LLC | Privacy Policy