From b01810cbb79bea8df60121b2752f2eee6e4d8b76 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 6 Sep 2017 22:01:26 +0000 Subject: [PATCH] Bye bye restart script --- XiaoBot.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/XiaoBot.js b/XiaoBot.js index 87667edb..e227bc8d 100644 --- a/XiaoBot.js +++ b/XiaoBot.js @@ -95,24 +95,6 @@ client.on('guildDelete', async guild => { dBotsOrg(count, client.user.id); }); -const { wait } = require('./structures/Util'); -client.setInterval(async () => { - let battle = client.registry.resolveCommand('games:battle').fighting.size; - let hangman = client.registry.resolveCommand('games:hangman').playing.size; - let gunfight = client.registry.resolveCommand('games:gunfight').fighting.size; - while (battle > 0 || hangman > 0 || gunfight > 0) { - if (battle > 0) console.log(`[RESTART] A battle is going on in Shard ${client.shard.id}, delaying...`); - if (hangman > 0) console.log(`[RESTART] A game of hangman is going on in Shard ${client.shard.id}, delaying...`); - if (gunfight > 0) console.log(`[RESTART] A gunfight is going on in Shard ${client.shard.id}, delaying...`); - await wait(300000); - battle = client.registry.resolveCommand('games:battle').fighting.size; - hangman = client.registry.resolveCommand('games:hangman').playing.size; - gunfight = client.registry.resolveCommand('games:gunfight').fighting.size; - } - console.log(`[RESTART] Shard ${client.shard.id} Restarted.`); - process.exit(0); -}, 8.64e+7); - client.login(TOKEN); process.on('unhandledRejection', console.error);