Class

GuildManager

Guild cache and manager with fetch. Extends Collection so you can use .get(), .set(), .filter(), etc.

Extends Collection

Constructor

new GuildManager(client: Client)
client
Client

Methods

.fetch(guildId)

guildId: string → Promise<Guild>

Fetch a guild by ID (returns cache if present).

await client.guilds.fetch(guildId);

.resolve(guildId)

guildId: string → Promise<Guild>

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

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

.set(key, value)

key: string, value: Guild → this

Set a guild in the cache (evicts oldest if at capacity).

client.guilds.set(key, value);