0
let guild = client.guilds.cache.get(msg.guild.id); guild.members.cache.each((member)=>{ console.log(member); }); 

logs only my id and the bots id. Anyone know the solution?

2
  • each? Did you mean forEach? Commented Feb 23, 2021 at 19:50
  • Its an object not an array so we use each instead of forEach. Commented Feb 23, 2021 at 19:52

1 Answer 1

0

The question has been answerd already here. If it still doesn't work, have you turned the gateway intents on in the Discord developer portal?

Gateway Intents

Sign up to request clarification or add additional context in comments.

2 Comments

@BlueSky That's weird, I had the same, with the bot logging only me and itself. But after turning the intents on, it worked. Btw, I tried using .each and .forEach, both worked for me..
K i will try after making the checkboxes on.