From a0c35bd61304458e1b1a0bb4c2730aa8dd3bf7d0 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Tue, 16 Nov 2021 19:30:07 +0100 Subject: [PATCH] Added kill module to repo. --- src/games/kill.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/games/kill.js diff --git a/src/games/kill.js b/src/games/kill.js new file mode 100644 index 0000000..7cb3251 --- /dev/null +++ b/src/games/kill.js @@ -0,0 +1,18 @@ +const config = require('config'); + +function onCommand(args, context) { + context.bot.socket.transmit('message', { + roomId: context.room.id, + body: 'Shutting down... :sleeping:', + style: config.style, + }); + + context.logger.info(`Kill command used by ${context.user.username}`); + + setTimeout(() => process.exit(), 1000); +} + +module.exports = { + commands: ['kill', 'restart', 'shutdown'], + onCommand, +};