#Getting a member list on new guild event

34 messages · Page 1 of 1 (latest)

haughty rune
#

I am trying to get a list of members when a new server add's my bot.
Listening on the event "client.on("guildCreate", async (guild) => {"

I am trying to print console.log(guild.members)

but i dont get anything userful

untold geode
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

haughty rune
#

I keep getting the same object

#

when i try to access the members part

tall bay
sinful falcon
#

technically he is doing the same thing

tall bay
#

not quite, fetch gives all members, list gives a max of 1000

#

list is a rest request, and fetch generates a gateway command that has discord send you gateway events in response

sinful falcon
#

not his issue by the sound of it. Also i already know that. Op 8 payload gives 1k each chunk until it already gets all, in large guild this wudnt be reliable

#

yep limit default to 1 for list thats why its showing 1 member

rose fog
#

So to sum it up: yes it was their issue, and no it’s not technically the same thing. And it’s reliable in large guilds too, just takes longer

haughty rune
#

but now i done get anything in my console log

full sphinx
haughty rune
full sphinx
#

This thing i suppose

haughty rune
#

yes

#

its on

full sphinx
#

i see

haughty rune
#

This is what i get

#

when i console log user

#

now i try to access the members object inside the guild

#

where do i get the members list

rose fog
#

You still only list 1 member if you don’t provide a limit: option in the list(…)
And what happened when you did .fetch() exactly?

haughty rune
#

got it

#

fetch didnt give any output for me