You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enabling intents mode makes it very difficult to keep using getAllMembers. Even a small bot of my size was having a 5x increase in bootup time. This made using getAllMembers essentially dead when enabling intents, as updating a bot or simply restarting would take too long.
Reason: Discord made it impossible to fetch members from multiple guilds at the same time meaning we now need to fetch 1 guild at a time.
Issue: Without the getAllMembers, the member cache is no longer filled meaning any events triggered on guildMemberUpdate will no longer be able to properly identify what changes were made. For example, there is no way to tell what role was added or removed. There is no way to tell what nickname was changed from. You will only get the current status.
I believe this also potentially effects guildMemberRemove as well. For example, when a member leaves but they were not cached this only sends a basic user object as opposed to a member. Imagine you had a feature keep a history of what roles a member had so that when they rejoined they would stay muted or keep whatever roles they had as opposed to bypassing server setups by just leaving and rejoining.
After discussion with Discord developers, they stated that they don't mind if we cache as much as we want but they just don't want us fetching members every time we startup. This means a system with something like Redis serving as a persistant cache for members is necessary for any bots using intents.
Milestone: v1.0 rewrite
The text was updated successfully, but these errors were encountered:
abalabahaha
changed the title
GuildMemberUpdate & GuildMemberRemove Potentially Broken With Intents Change
Intents causing cache-reliant features to fail
May 12, 2020
Enabling intents mode makes it very difficult to keep using getAllMembers. Even a small bot of my size was having a 5x increase in bootup time. This made using getAllMembers essentially dead when enabling intents, as updating a bot or simply restarting would take too long.
Reason: Discord made it impossible to fetch members from multiple guilds at the same time meaning we now need to fetch 1 guild at a time.
Issue: Without the getAllMembers, the member cache is no longer filled meaning any events triggered on
guildMemberUpdate
will no longer be able to properly identify what changes were made. For example, there is no way to tell what role was added or removed. There is no way to tell what nickname was changed from. You will only get the current status.I believe this also potentially effects guildMemberRemove as well. For example, when a member leaves but they were not cached this only sends a basic user object as opposed to a member. Imagine you had a feature keep a history of what roles a member had so that when they rejoined they would stay muted or keep whatever roles they had as opposed to bypassing server setups by just leaving and rejoining.
After discussion with Discord developers, they stated that they don't mind if we cache as much as we want but they just don't want us fetching members every time we startup. This means a system with something like Redis serving as a persistant cache for members is necessary for any bots using intents.
Milestone: v1.0 rewrite
The text was updated successfully, but these errors were encountered: