#Members didn't arrived in time.

85 messages · Page 1 of 1 (latest)

sly minnow
#

why do I get this error sometimes when I try to fetch selective members?

dense oreBOT
#

• 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.

sly minnow
proper girder
#

Make sure you have GUILD_MEMBERS intent

sly minnow
#

Yes I do have it.

#

It just happens I try to fetch selective members

vague sorrel
#

If its attempting to fetch say, 20 IDs

#

And they arent all in the server

#

It times out waiting for the rest

#

I think

sly minnow
#

hmm so how would I implement this without fetching every single member?

pastel crescent
#

a) not
b) specifying some timeout you want to wait for and assuming there were none if it doesn't return anything

sly minnow
#

or does this error occur when no members are found?

pastel crescent
#

well, if there are results they will arrive

sly minnow
#

oh so that means this error means no members were found on the guild right?

pastel crescent
#

the issue with it is the arbitrary timeframe, "wait for <some magic number> and assume" is not a workflow i like, personally

#

not necessarily

sly minnow
#

oh

pastel crescent
#

could also be that the connection was bad or that you just didn't wait long enough

#

the error means what it says, really

sly minnow
#

ya get it

#

ig I just have to fetch all of them

pastel crescent
#

you made a request to get member payloads, but they didn't arrive after the (specified) timeout duration

sly minnow
#

ya got it

#

Thanks :)

pastel crescent
#

so yeah, i personally prefer to just fetch all and live with that interface being absolutely unusable firL

sly minnow
#

;__;

#

lol

pastel crescent
#

do keep in mind, though, that fetching all doesn't scale all that well as they arrive in chunks
for an 800k server i wait betewen 15 and 30 seconds just so members arrive

sly minnow
#

ya that's why I wanted to fetch only the required ones

pastel crescent
#

what's the ballpark for the req. ones we're talking about?

#

if it's not a whole lot iterating and fetching them via rest as single members might even be a better approach

sly minnow
#

nope...there could be any amount from 1-50 members and 50 becomes bad when fetching each one

#

could be more members but thats the average

pastel crescent
#

does it?

sly minnow
#

ya I have tried

#

it was taking like a whole min to do stuff sometimes

pastel crescent
#

firT i think i've def. fetched members at that scale before without much issues

#

the user endpoint is rather heavily limited, but single members?

sly minnow
#

huhhhhhh right actually....I have fetched users when I was fetching them individually and haven't used each member fetch

#

hmmmm

pastel crescent
#

yeah, fetching users is horrendous

#

because that can be global users

#

but members that have to be on the server are usually fine

sly minnow
#

could be that ig I will implement that and test

pastel crescent
#

i mean, should prob. not do it at like.. thousands

#

at some point fetching all is def. preferable

sly minnow
#

if it works I will set a limit like for < 50-100 fetch each members and after that fetch mass and use those.

#

ya

pastel crescent
#

and if your server(s) are generally much smaller fetching all won't take any time at all

#

like..

#

-ev msg.guild.members.fetch().then(m => m.size)

ember fableBOT
sly minnow
#

oh ya I could also check the member count as well

pastel crescent
#

that aint that bad, 2.5s for 60k

sly minnow
#

right

#

so I could account for amount of member trying to fetch and the size of the guild

#

that should work

pastel crescent
#

or you can just fetch all and make sure you defer and maybe inform the user that something is happening

#

looking at "bot is thinking" for 30s sure isn't the best UX

sly minnow
#

ya lol but will there be any rate-limits? like come times a new feature comes and all server just run tons of shit lol

pastel crescent
#

becomes even more fun if you bulk-ban thousands of members, which might take north of 15minutes so the slash webhook expires firL

sly minnow
#

like ik there will be but I just don't wanna spam the hell out of the api

#

lol

pastel crescent
#

firShrug who knows what discord will do
doubt they even know themselves

sly minnow
sly minnow
#

no like this works beyond that

pastel crescent
#

can't, because the webhook token expires after 15

sly minnow
#

oh

#

hmm

#

dahell that's weird cause issues were fixed after I did this....?
what will be the better way to edit the message after 15 mins?

pastel crescent
#

afaik you need the message instance with fetchReply set and then call edit on that without the whole webhook shenanigans

sly minnow
#

oh so like re-fetch every 15 mins? or just a single re-fetch will be forever?

pastel crescent
#

single fetch, but use the endpoint to edit the regular channel message, not with the webhook endpoint