First working draft of inventory sync

This commit is contained in:
Daniel committed 2021-07-12 22:05:53 +02:00
1 parent a578719fc5
commit 86bd07666f
12 files changed
+512

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
"use strict";
const libPlugin = require("@clusterio/lib/plugin");
const info = require("./info");
const libCommand = require("@clusterio/lib/command");
const globalChatCommands = new libCommand.CommandTree({
name: "global-chat", description: "Global Chat plugin commands",
});
globalChatCommands.add(new libCommand.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 info.messages.chat.send(control, {
instance_name: "Console",
content: args.message,
});
},
}));
class ControlPlugin extends libPlugin.BaseControlPlugin {
async addCommands(rootCommand) {
rootCommand.add(globalChatCommands);
}
}
module.exports = {
ControlPlugin,
};