From 3219ec6155d003b0451762639be9dff3d28bbf3e Mon Sep 17 00:00:00 2001 From: jay Date: Tue, 5 Jan 2021 11:32:33 +0500 Subject: [PATCH] feat(informer): :sparkles: actually add a command for info plugin --- lib/plugins/command.js | 3 +++ lib/plugins/informer.js | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/plugins/command.js b/lib/plugins/command.js index aeffc24..c013ffd 100644 --- a/lib/plugins/command.js +++ b/lib/plugins/command.js @@ -396,6 +396,9 @@ function command(username, message) { break } break + case "info": + cfg.plugins.informer.command(message_parts.splice(1)) + break case "ride": case "mount": bot.mount(bot.nearestEntity()) diff --git a/lib/plugins/informer.js b/lib/plugins/informer.js index 9815e8a..cfb4768 100644 --- a/lib/plugins/informer.js +++ b/lib/plugins/informer.js @@ -10,6 +10,24 @@ function block() { cfg.quiet || bot.chat(info.join(": ")) } +function command(message_parts) { + switch (message_parts.length) { + case 0: + case 1: + switch (message_parts[0]) { + case "block": + default: + block() + break; + } + + break; + + default: + break; + } +} + const load = (config) => { cfg = config bot = cfg.bot @@ -21,4 +39,4 @@ const load = (config) => { const unload = () => {} -module.exports = { load, unload, block } \ No newline at end of file +module.exports = { load, unload, command, block } \ No newline at end of file