ReactiveTurtle🌸🥀
ReactiveTurtle🌸🥀
DIAdiscord.js - Imagine an app
Created by ReactiveTurtle🌸🥀 on 4/22/2025 in #djs-questions
How does CachedManager work?
How does CachedManager<Snowflake, GuildMember, GuildMemberResolvable> (specifically guild.members.cache) work in discord.js v14? When and how are members added to the cache? Is it only populated after explicitly calling guild.members.fetch() or guild.members.list()? Does it persist for the lifetime of the bot client, or is it tied to individual events like receiving an interaction or message? I'm trying to understand the caching behavior and in what situations I can rely on guild.members.cache.get(id) returning a result. Thanks!
20 replies