GraphMine

graphmine-core / io.github.sof3.graphmine.command / CommandExecutor

CommandExecutor

class CommandExecutor<A : Overload, S : CommandSender, C : Scope>

The this context of command handlers.

Other modules are encouraged to create extension functions on this class for more convenient handling.

Parameters

A - the type of overload. Can be any supertype of the actual overload.

S - the type of command sender. Can be any supertype of the actual sender.

C - the scope of the command execution.

Properties

args val args: A
the parsed overload instance
receiver val receiver: CommandReceiver
the object to send command output into
scope val scope: C
the scope that owns the command
sender val sender: S
the sender that sent the command

Functions

respond fun respond(message: I18n): Unit
Responds to the command sender. A shortcut for receiver.receiveMessage.
specialize fun <SubA : Overload, SubS : CommandSender> specialize(): CommandExecutor<SubA, SubS, C>?
Restricts the command executor to its subtypes.