guild member timeout

I've been trying to fix this for 3 hours now.
No description
No description
9 Replies
d.js toolkit
d.js toolkit3w ago
Samtino
Samtino3w ago
Are you fetching all guild members more than once every 30 seconds?
d.js toolkit
d.js toolkit3w ago
Discord introduced a rate limit on requesting all guild members (source) -# Despite the announced 01/10/2025 rollout date, it only took effect recently. - Apps may only request all members once per 30s per guild. - You will have to update your code accordingly to make sure this doesn't affect your app. - Look for instances of guild.members.fetch() with no user ids. -# We are working on making the GuildMemberManager#fetch() call reject if we receive this rate limit after requesting members. This will likely land in the next release. -# If you confirmed this cannot be the reason, you can find other caveats in our guide :djsguide:.
Emild
EmildOP3w ago
no every 30 seconds but every time someone joins or leaves the guild
Samtino
Samtino3w ago
DJS will handle the caching for that automatically And if you have your own separate cache/DB of members, just add/remote/update members on the gateway events...there's no reason to fetch ALL members every time
Emild
EmildOP3w ago
yes i know but on an other bot im dong it only once an its the same problem
Samtino
Samtino3w ago
Can you share the code from that bot? How are you using guild.members.fetch() there?
Emild
EmildOP3w ago
yes but the code is in german
Samtino
Samtino3w ago
1. Your loadguilds() method seems to be redundantly fetching guild information...guild.roles is kept up to date automatically 2. You are calling guild.members.fetch() 3 different places there....the only time you need to call it is once...then the gateway keeps the cache updated

Did you find this page helpful?