Added kill command and PM2 ecosystem file with restart delay.
This commit is contained in:
parent
701cf82af8
commit
f455635e0a
|
@ -0,0 +1,4 @@
|
||||||
|
module.exports = {
|
||||||
|
script: 'src/app.js',
|
||||||
|
restart_delay: 5000,
|
||||||
|
};
|
|
@ -145,6 +145,11 @@ function onMessage(message, bot, games) {
|
||||||
const user = bot.users[message.userId] || message.user;
|
const user = bot.users[message.userId] || message.user;
|
||||||
const room = bot.rooms[message.roomId];
|
const room = bot.rooms[message.roomId];
|
||||||
|
|
||||||
|
if (command === 'kill') {
|
||||||
|
process.exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (command) {
|
if (command) {
|
||||||
const args = body.split(/\s+/).slice(1);
|
const args = body.split(/\s+/).slice(1);
|
||||||
const game = games[command];
|
const game = games[command];
|
||||||
|
|
Loading…
Reference in New Issue