2

When i run the code below it gives only 1 member which is the bot it self. (in my test server with the bot and me.) Is there a way to refresh/update the members cache?

console.log(MainGuild.members.cache)
Tinus NL
  • 23
  • 1
  • 4

1 Answers1

3

You can fetch every member in a guild with GuildMemberManager.fetch()

MainGuild.members.fetch().then((members) => {
 console.log(members);
 // code...
});

This might also be related: None of my discord.js guildmember events are emitting

Lioness100
  • 8,260
  • 6
  • 18
  • 49