Skip to content

Commands

To register commands, you must use the register method provided by the registry.

This will load all child ModuleScript in the provided Instance.

Any methods that are decorated with @Command will be registered, as long as its parent class is decorated with @Commander.

CommanderServer.start((registry) => {
registry.register(script.Parent.commands);
}).catch((err) => warn("Commander could not be started:", tostring(err)));

If you’re using another method to load modules (such as Flamework’s addPaths), you can use registerCommands to register them instead.

Flamework.addPaths("src/server/commands");
CommanderServer.start((registry) => {
registry.registerCommands();
}).catch((err) => warn("Commander could not be started:", tostring(err)));