Members didn't arrived in time.
why do I get this error sometimes when I try to fetch selective members?
49 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.Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Yes I do have it.
It just happens I try to fetch selective members
If its attempting to fetch say, 20 IDs
And they arent all in the server
It times out waiting for the rest
I think
hmm so how would I implement this without fetching every single member?
a) not
b) specifying some timeout you want to wait for and assuming there were none if it doesn't return anything
hmm is there a way I can just make it ignore all the members that didn't came on time and just get all the other ones?
or does this error occur when no members are found?
well, if there are results they will arrive
oh so that means this error means no members were found on the guild right?
the issue with it is the arbitrary timeframe, "wait for <some magic number> and assume" is not a workflow i like, personally
not necessarily
oh
could also be that the connection was bad or that you just didn't wait long enough
the error means what it says, really
ya get it
ig I just have to fetch all of them
you made a request to get member payloads, but they didn't arrive after the (specified) timeout duration
ya got it
Thanks :)
so yeah, i personally prefer to just fetch all and live with that interface being absolutely unusable
;__;
lol
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
ya that's why I wanted to fetch only the required ones
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
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
does it?
ya I have tried
it was taking like a whole min to do stuff sometimes
i think i've def. fetched members at that scale before without much issues
the user endpoint is rather heavily limited, but single members?
huhhhhhh right actually....I have fetched users when I was fetching them individually and haven't used each member fetch
hmmmm
yeah, fetching users is horrendous
because that can be global users
but members that have to be on the server are usually fine
could be that ig I will implement that and test
nice
i mean, should prob. not do it at like.. thousands
at some point fetching all is def. preferable
if it works I will set a limit like for < 50-100 fetch each members and after that fetch mass and use those.
ya
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)
• d.js
14.0.1
• Type: number
• time taken: 2536.633259ms
oh ya I could also check the member count as well
that aint that bad, 2.5s for 60k
right
so I could account for amount of member trying to fetch and the size of the guild
that should work
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
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
becomes even more fun if you bulk-ban thousands of members, which might take north of 15minutes so the slash webhook expires
like ik there will be but I just don't wanna spam the hell out of the api
lol
ya happened to me before lol
who knows what discord will do
doubt they even know themselves
only for 15 minutes
no like this works beyond that
can't, because the webhook token expires after 15
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?
afaik you need the message instance with fetchReply set and then call edit on that without the whole webhook shenanigans
oh so like re-fetch every 15 mins? or just a single re-fetch will be forever?
afaik #editReply doesn't do anything different than that, and that def. failed after 15 minutes
i will, however check that out again
that's simplify things quite tremendously
because atm that means i do need view perms for the bot in the channel the command is ran in, which wouldn't be the case if i oculd use the wh
single fetch, but use the endpoint to edit the regular channel message, not with the webhook endpoint
right
oh got it
i will test this too