From f6da7657f7b70dd9d1e2b064692ac6977eaf2341 Mon Sep 17 00:00:00 2001 From: Cristiano Pires Date: Sat, 11 Mar 2023 14:52:52 +0000 Subject: [PATCH] Error handling attempt, on lost connection --- server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 3aa1775..9f598c3 100644 --- a/server.js +++ b/server.js @@ -54,7 +54,10 @@ const bot = new Client({ intents: [ Partials.Message ] }); -bot.login(process.env.discord_token); +function login() +{ + bot.login(process.env.discord_token).catch(()=>{login()}); +} function connectToDB() {