#Wrong guild.memberCount?

12 messages · Page 1 of 1 (latest)

cold sparrow
#

Hi,

There's any reason why in a 9k users server this, sometimes, return a completely wrong user count?

// discord.js ^14.14.1
module.exports = {
    event: 'guildMemberAdd',
    run: async (client, member) => {
        console.log('member.guild.memberCount);

I mean: it used to work fine for many months, but in last 2 days it started, sometimes, to return values like 1534 or similar ones, instead of 8-9k+. There's any known bug?

rigid whaleBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
cold sparrow
#

(this the last logs, memberCount in yellow)

narrow briar
cold sparrow
narrow briar
#

yes

cold sparrow
# narrow briar yes

It makes sense. It used to be in some unused servers, probably the best bet is to kick it from any server considering I want to use it now only in this one. There's a way to let the bot leave all servers but not the one I want (serving it the right server id)?

narrow briar
#

filter the guilds.cache and use leave() on everything thats not a specific id

cold sparrow
#

Ye added now, but this should work to let it leave any server during time, not?

if (obj.guild.id !== 'my-server-id' {
  obj.guild.leave();
}

Thank you!

cold sparrow
#

👍👍