How can discord.js cache all users, channels, guilds into Collection?

Title
10 Replies
d.js toolkit
d.js toolkit•3y ago
• 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.
chewie
chewie•3y ago
Please elaborate your question a bit more
Louiz
LouizOP•3y ago
Like how discord.js does so that instead of fetching data, users can use cache instead? Like guilds.cache for example?
chewie
chewie•3y ago
The client receives the data based on intents If you have the Guilds intent, channels will be sent at the startup Same for roles etc., but not for users
Louiz
LouizOP•3y ago
so users need to be fetched before?
treble/luna
treble/luna•3y ago
you cannot fetch all users
Louiz
LouizOP•3y ago
yeah ik, but how users.cache work? is that members data from the guilds?
treble/luna
treble/luna•3y ago
thats just cached users not members
chewie
chewie•3y ago
That contains users your bot interacted with in any way, like receiving events from them
Louiz
LouizOP•3y ago
ty

Did you find this page helpful?