What is cached?

I can't seem to find a solid answer for this, what is always cached by discord js on startup and what needs to be fetched? Right now my understanding is guilds and channels are always cached, while members should be fetched always. Not sure about roles
6 Replies
Favna
Favna2y ago
GitHub
discord.js/index.d.ts at main · discordjs/discord.js
A powerful JavaScript library for interacting with the Discord API - discord.js/index.d.ts at main · discordjs/discord.js
Ravelt
RaveltOP2y ago
Sorry let me clarify my question, what is always in the cache? I'm asking this because I remember reading somewhere that channels are always cached so you don't need to fetch, but for users/members you should always fetch because they might not be cached yet. Don't know if that's actually true or not
Favna
Favna2y ago
that is correct but in 9/10 cases that data is going to be cached just fine unless you're sweeping aggresively through your own sweeper config
Ravelt
RaveltOP2y ago
I see thanks Then to confirm roles are also always in the cache?
kyra
kyra2y ago
Yeah And up to date as well, unless there's a rare API issue that prevents them from sending updates to us
Ravelt
RaveltOP2y ago
Awesome thanks
Want results from more Discord servers?
Add your server