diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..0eb9b92 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,4 @@ +module.exports = { + script: 'src/app.js', + restart_delay: 5000, +}; diff --git a/src/app.js b/src/app.js index 406508d..fbc32f7 100644 --- a/src/app.js +++ b/src/app.js @@ -145,6 +145,11 @@ function onMessage(message, bot, games) { const user = bot.users[message.userId] || message.user; const room = bot.rooms[message.roomId]; + if (command === 'kill') { + process.exit(); + return; + } + if (command) { const args = body.split(/\s+/).slice(1); const game = games[command];