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

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