Get All users banners
So im trying to get all banners of server members.. what im doing is fetching all members
let members = await guild.members.fetch();
but all the members here have banners as null. ik they need to be force fetched.
so i tried something like this
but it still gives the same output25 Replies
- 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.
- Issue solved? Press the button!Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Thanks! I'll give it a try
mmh it still give me an empty array
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
make sure to use
for await
Yes no problem, so it's a custom bot for somoene it just get all users banners and every 1 days using cron it send a random banner in a channel
yes ofc, well it worked but i want a better way to do that
what i thinked of is something like client.users.fetch({force: true})
but thats dont exist
not sure what you mean by "better way"
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
i mean this spammy like jo said
but maybe an interval of 5 minutes can help?
i have an idea
You can just specify the members you want to fetch.
Or just fetch all members
well i just need 1 banner so i'll make it stop when i get1 banner
Btw I don't think your
members
is an async iterator, so you don't need for await
await is for the client.users.fetch
well i just tested now it work with only
for
alright
does this make only one request?
Yes
o
But for that you need
GuildMembers
intenti did this for now
i think the break method don't work great
cause it gonna give the same banner every time:=
i need to make a function that shuffle the members collection