@clusterio/plugin-global_chat
Version:
Clusterio plugin forwarding between Factorio servers
24 lines • 937 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CtlPlugin = void 0;
const lib_1 = require("@clusterio/lib");
const ctl_1 = require("@clusterio/ctl");
const messages_1 = require("./messages");
const globalChatCommands = new lib_1.CommandTree({
name: "global-chat", description: "Global Chat plugin commands",
});
globalChatCommands.add(new lib_1.Command({
definition: ["shout <message>", "Send message to all instances", (yargs) => {
yargs.positional("message", { describe: "message to send", type: "string" });
}],
handler: async function (args, control) {
await control.sendTo("allInstances", new messages_1.ChatEvent("Console", args.message));
},
}));
class CtlPlugin extends ctl_1.BaseCtlPlugin {
async addCommands(rootCommand) {
rootCommand.add(globalChatCommands);
}
}
exports.CtlPlugin = CtlPlugin;
//# sourceMappingURL=control.js.map