GraphMine

graphmine-core / io.github.sof3.graphmine.command / Command / <init>

<init>

Command(fn: Command<C>.() -> Unit)

This class represents a command type. Each instance of Command should represent one registered command.

Subclasses must initialize the name property.

/**
 * Implements the /version command
 */
object VersionCommand : Command<Server>({
	name = "graphmine.version".qualify()
	aliases += "v"

	description = CoreLang.commands.version.description(Unit)

	handle<EmptyOverload, CommandSender> {
		respond(CoreLang.commands.version.response(VersionResponse(VersionInfo.VERSION)))
	}
})

Parameters

fn - A lambda to initialize the command.