From c0cb2f4c7c9fc6f471aa35282e29c19131f745c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Sun, 14 Nov 2021 15:00:32 +0100 Subject: [PATCH] Try to auto reconnect --- app.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.ts b/app.ts index 9060a50..c2e187b 100644 --- a/app.ts +++ b/app.ts @@ -46,6 +46,12 @@ teamspeak.on("ready", async () => { teamspeak.clientMove(whoami.clientId, channel[0].cid); }); +teamspeak.on("close", async () => { + console.log("disconnected, trying to reconnect..."); + await teamspeak.reconnect(-1, 60000); + console.log("reconnected!"); +}); + teamspeak.on("error", (e) => { console.log("Caught an error!"); console.error(e); -- 2.44.0