cache members

let getguild = await client.guilds.fetch("ID")
let getmembers = await c.members.fetch()
let getguild = await client.guilds.fetch("ID")
let getmembers = await c.members.fetch()
once i got all members fetch, how can i loop thorugh each one? is it through .cache.get?
5 Replies
chewie
chewie3y ago
getmembers is a collection so either forEach or a normal for loop
Mulo
MuloOP3y ago
so i need to get specific users from a separate list i have. So you are saying normal for loop through getmembers tho in other occasions i just used member.cache.get("ID") Is it possible to do that instead of looping though getmembers?
chewie
chewie3y ago
yes member.cache would be a collection as well .get is a method of collection
Mulo
MuloOP3y ago
is it getmembers.cache.get("ID")?
chewie
chewie3y ago
no, again, getmembers is a collection .get is a method of collection what do we get from that? getmembers.get()
Want results from more Discord servers?
Add your server