CommandAPI icon indicating copy to clipboard operation
CommandAPI copied to clipboard

Kotlin Corountines Support for Custom Arguments

Open TheBjoRedCraft opened this issue 9 months ago • 0 comments

Description

There should be a suspending parseArgument method for creating asnyc custom arguments with Kotlin. This could be used to load database informations or fetch http requests without blocking the servers main thread. The Command should be executed when all async arguments has been completed.

Expected code

something like

    @Throws(CommandSyntaxException::class)
    abstract suspend fun parseSuspendingArgument(
        context: CommandContext<Source>, 
        name: String,
        arguments: CommandArguments
    ): T

Extra details

This should be available on all platforms.

TheBjoRedCraft avatar Apr 02 '25 12:04 TheBjoRedCraft