Class

GuildManager

Guild cache and manager with fetch. Extends LimitedCollection so you can use .get(), .set(), .filter(), etc. FIFO-evicts (and cascades nested caches) when at the resolved cache.guilds limit.

Extends LimitedCollection

Constructor

new GuildManager(client: Client)
client
Client

Methods

.delete(key)

key: stringboolean

Remove a guild from cache and cascade its channels / message caches. Does not leave the guild. Use user.leaveGuild for that.

client.guilds.delete(key);

.fetch(guildId, options?)

guildId: string, options?: { force?: boolean; }Promise<Guild>

Fetch a guild by ID. Returns the cached guild unless force is set, in which case REST metadata is applied via _patch.

await client.guilds.fetch(guildId);

.resolve(guildId)

guildId: stringPromise<Guild>

Get a guild from cache or fetch from the API if not present.

guildId
stringSnowflake of the guild
await client.guilds.resolve(guildId);