From f0194d697ac4b487b33d3d207c0cdd3f2bbc1a8f Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Fri, 10 May 2024 09:56:11 -0600 Subject: [PATCH] Remove guild members intent and possibly fix weird crash --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6db3515..70e2d84 100644 --- a/index.js +++ b/index.js @@ -14,8 +14,7 @@ const sqlite3 = require("sqlite3").verbose(); const discord = new Discord.Client({ intents: [ "Guilds", - "GuildVoiceStates", - "GuildMembers" + "GuildVoiceStates" ] }); const { @@ -453,6 +452,15 @@ xmpp.on("online", async (address) => { }, 1000) }); +xmpp.on("close", () => { + console.log(`${colors.yellow("[WARN]")} XMPP connection closed, trying to reconnect...`); + setTimeout(() => { + xmpp.stop().then(() => { + start(); + }); + }, 5000); +}) + const start = () => { xmpp.start().catch((err) => { errCount++;