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

io.github.freya022.botcommands.api.parameters.resolvers.QuotableTextParameterResolver.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.

The newest version!
package io.github.freya022.botcommands.api.parameters.resolvers

import io.github.freya022.botcommands.api.commands.text.annotations.JDATextCommandVariation
import io.github.freya022.botcommands.api.parameters.ParameterResolver
import java.util.regex.Pattern

/**
 * Parameter resolver for parameters of [@JDATextCommandVariation][JDATextCommandVariation].
 *
 * This resolver is an extension of [TextParameterResolver], but the regex pattern is quoted to help command parsing.
 *
 * Needs to be implemented alongside a [ParameterResolver] subclass.
 *
 * @param T Type of the implementation
 * @param R Type of the returned resolved objects
 */
interface QuotableTextParameterResolver : TextParameterResolver
        where T : ParameterResolver,
              T : QuotableTextParameterResolver {
    /**
     * A quoted pattern of the parameter resolver.
     *
     * @see TextParameterResolver.pattern
     */
    val quotedPattern: Pattern

    override val preferredPattern: Pattern
        get() = quotedPattern
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy