From c9b743fdd0a8b7f4ee86f7f8c4685d9e23d7f7d7 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Fri, 19 Aug 2022 07:20:31 +0700 Subject: [PATCH] ssasddsafdsa --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 423ff8f..a74bb1c 100644 --- a/index.js +++ b/index.js @@ -375,8 +375,10 @@ function main() { bot.chat('Interrupted by console'); process.exit(); }); +} - bot.once('end', (reason, event) => { +function onEnd() { + bot.on('end', (reason, event) => { console.log(`Disconnected (${event} event): ${util.inspect(reason)}`); dcmsg.queue += '\n' + `Disconnected (${event} event): ${util.inspect(reason)}`; @@ -431,6 +433,7 @@ dcclient.on('ready', async () => { } await sleep(200); main(); + onEnd(); chomenschannel = dcclient.channels.cache.get(chomenschannel); bot.hashchannel = dcclient.channels.cache.get(hashchannel); bot.ownerhashchannel = dcclient.channels.cache.get(ownerhashchannel);