From fdb3abd8e2e7898cbb547578505596c8a4e2918d Mon Sep 17 00:00:00 2001 From: Ethan Matten <24141433+Madzahttr@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:50:25 +1300 Subject: [PATCH 1/2] hopefully fix the online counter --- src/bot.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bot.js b/src/bot.js index 0b9028b..9bad4a5 100644 --- a/src/bot.js +++ b/src/bot.js @@ -10,15 +10,16 @@ global.settings = { global.factory = require('./factory'); +const intents = new Intents([ + Intents.NON_PRIVILEGED, + "GUILD_MEMBERS", +]); + const bot = new Discord.Client({ ws: { - intents: [ - 'DIRECT_MESSAGES', - 'GUILD_MESSAGES', - 'GUILD_MEMBERS', - 'GUILDS', - ] - } + intents + }, + fetchAllMembers: true }); const managers = bot.managers = new ManagerHandler() From e3a098914924b61a6245416a5aa8fe42d4df571d Mon Sep 17 00:00:00 2001 From: Ethan Matten <24141433+Madzahttr@users.noreply.github.com> Date: Mon, 6 Dec 2021 19:07:35 +1300 Subject: [PATCH 2/2] fix online count and intents --- src/bot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bot.js b/src/bot.js index 9bad4a5..c3fec28 100644 --- a/src/bot.js +++ b/src/bot.js @@ -1,6 +1,6 @@ const path = require('path'); const chalk = require('chalk'); -const Discord = require('discord.js'); +const { Discord, Intents } = require('discord.js'); const ManagerHandler = require('./managers'); global.settings = { @@ -11,8 +11,8 @@ global.settings = { global.factory = require('./factory'); const intents = new Intents([ - Intents.NON_PRIVILEGED, - "GUILD_MEMBERS", + Intents.NON_PRIVILEGED, + Intents.FLAGS.GUILD_MEMBERS ]); const bot = new Discord.Client({