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
basically this is the list: https://github.com/discordjs/discord.js/blob/main/packages/discord.js/typings/index.d.ts#L4633-L4659 (including those marked as TODO here)
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
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
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
I see thanks
Then to confirm roles are also always in the cache?
Yeah
And up to date as well, unless there's a rare API issue that prevents them from sending updates to us
Awesome thanks