forked from ChrisChrome/weather-bot
Remove guild members intent and possibly fix weird crash
This commit is contained in:
parent
688954fa11
commit
f0194d697a
12
index.js
12
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++;
|
||||
|
|
Loading…
Reference in a new issue