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
Favna13mo 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
Ravelt13mo 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
Favna13mo 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
Ravelt13mo ago
I see thanks Then to confirm roles are also always in the cache?
kyra
kyra13mo ago
Yeah And up to date as well, unless there's a rare API issue that prevents them from sending updates to us
Ravelt
Ravelt13mo ago
Awesome thanks
Want results from more Discord servers?
Add your server
More Posts