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

Title
10 Replies
d.js toolkit
d.js toolkit2y 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
chewie2y ago
Please elaborate your question a bit more
ilosu
ilosuOP2y ago
Like how discord.js does so that instead of fetching data, users can use cache instead? Like guilds.cache for example?
chewie
chewie2y 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
ilosu
ilosuOP2y ago
so users need to be fetched before?
treble/luna
treble/luna2y ago
you cannot fetch all users
ilosu
ilosuOP2y ago
yeah ik, but how users.cache work? is that members data from the guilds?
treble/luna
treble/luna2y ago
thats just cached users not members
chewie
chewie2y ago
That contains users your bot interacted with in any way, like receiving events from them
ilosu
ilosuOP2y ago
ty
Want results from more Discord servers?
Add your server