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

com.freya02.botcommands.internal.commands.application.context.user.UserContextCommandParameter.kt Maven / Gradle / Ivy

package com.freya02.botcommands.internal.commands.application.context.user

import com.freya02.botcommands.api.commands.application.context.builder.UserCommandOptionAggregateBuilder
import com.freya02.botcommands.api.commands.application.context.builder.UserCommandOptionBuilder
import com.freya02.botcommands.api.parameters.UserContextParameterResolver
import com.freya02.botcommands.internal.BContextImpl
import com.freya02.botcommands.internal.CommandOptions
import com.freya02.botcommands.internal.commands.application.context.ContextCommandParameter
import com.freya02.botcommands.internal.transform

class UserContextCommandParameter(
    context: BContextImpl,
    optionAggregateBuilder: UserCommandOptionAggregateBuilder
) : ContextCommandParameter(context, optionAggregateBuilder) {
    override val nestedAggregatedParameters = optionAggregateBuilder.nestedAggregates.transform {
        UserContextCommandParameter(context, it)
    }

    override val options = CommandOptions.transform(
        context,
        optionAggregateBuilder,
        object : CommandOptions.Configuration> {
            override fun transformOption(
                optionBuilder: UserCommandOptionBuilder,
                resolver: UserContextParameterResolver<*, *>
            ) = UserContextCommandOption(optionBuilder, resolver)
        }
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy