Error [GUILD_MEMBERS_TIMEOUT] Members didn't arrive in time.
Hi, I'm getting this err when bot starts & it does not execute any event (including ready event) when this err arrives.
It's not happening all the time.. err:
33 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.djs version -
13.6.0
you are missing the GUILD_MEMBERS intent
@thehairy Hi, sorry for late reply
I have these intents:
and weird part is that it's not happening every time
that error ^
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
This error can be thrown if the guild you are trying to fetch is too big
And you have a slow connection
https://discordjs.guide/popular-topics/errors.html#members-didn-t-arrive-in-time
same error here, hmm
i think it may be related to connection or something, but the discord status page doesn't say anything
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
api issue ig
Guild.fetch() when fetching all members use the WS not the Api, it's a wierd behavior it not responding, since if the gateway isn't working I don't think only will fail the fetch but the whole connection instead
I know, my bot seems to connect for a while (even sets playing status) but then goes offline with that error
This started happening after a reboot because it wouldn't detect member joins/leaves
yes it is
I saw this error multiple times when the bot starts and only when the bot starts... but not every time
I did not completely understand this line but I think when bot goes online & fetches guilds & members to set cache it fails connection and
ready
event is not being called in these cases
Bot's activity status is not updated (that is being set in ready
event)Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Do you, in anyway, fetch the members manually?
Bc this is the only way this error is throw
https://github.com/discordjs/discord.js/search?q=GuildMembersTimeout
yes, I do
I fetch guild member using id stored in db for vote reminder when the bot starts.. Also I fetch at some other places but I don't think they're relevant here
I fetch guild member using id stored in db for vote reminder when the bot starts.Can you show the code?
Oh, your id
My bad
I'm talking about
<Guild>.members.fetch()
with no options
Or just the time optionno i don't fetch guild anywhere, I read it from cache, as seen in above screenshot ^
Sorry
See the edit lol
as far as I can remember I don't, lemme verify
yes I do
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I fetch all members when bot joins a server to see active boosters
thanks 😄
Your bot might have been added to a fairly large server
Like 100k members or more
Thats what probably causing the issue
Try setting the
time
option to smt bigger
The default iirc is two minutes (in ms)
Yeah 120e3 msokay, thanks for the help, I'll try this
but I'm still confused that somehow bot does not responds to and msg or updates activity status when I restart it (rare but happens some times)
I thought it was due to this err ^
but I guess these things are not related?
Also you can't fetch more than one guild member at the time
If you seen fit
You can add some type of async queue and error handler
You can use the
@sapphire/async-queue
for thisThanks a lot, I'll run async process for this..
Also, If I decide to run this async process every day for all guilds, do you think it should be an issue?
There is a
large_guild
threshold on discord, on those giant guilds discord only sends online members on the ready event
That might be the issue, uncached members
I don't think you should fetch every member of all your guilds your bot is in everyday
Try to restart as few as possiblehow will un-cached members be an issue here?
The guild member update event will send an partial member on the first argument and a full member on the second
And you cant
fetch
this old memberyes, that's what I thought but bot misses role remove events of un-cached members (partial event) and not able to detect if someone removed boost or it was some normal role removed.. I was planning to run a cron but this sounded bad in my head.. I'll try to come up with something else
but I think issue occurs before
ready
event.. guild member update event is irrelevant in this case right?Roles are always cached
But you use roles to detect bosts?
You can use the member properties
They are more reliable
to detect boost remove event
member who removed boost is not always cached