Skip to content

GuildManager

Package: @erinjs/core

Manages guilds with fetch. Extends Collection so you can use .get(), .set(), .filter(), etc.

Constructor

NameTypeOptionalDescription
clientClientNo

Properties

NameTypeReadonlyOptionalDescription
maxSizenumberYesNo

Methods

create() async

Create a guild. POST /guilds.

Returns: Promise<Guild>

Parameters:

NameTypeOptionalDescription
options{ name: string; icon?: string | null; empty_features?: boolean; }Noname (required), icon (base64), empty_features

fetch() async

Fetch a guild by ID from the API (or return from cache if present).

Returns: Promise<Guild | null>

Parameters:

NameTypeOptionalDescription
guildIdstringNoSnowflake of the guild

resolve() async

Get a guild from cache or fetch from the API if not present. Convenience helper to avoid repeating client.guilds.get(id) ?? (await client.guilds.fetch(id)).

Returns: Promise<Guild | null>

Parameters:

NameTypeOptionalDescription
guildIdstringNoSnowflake of the guild

set()

Returns: this

Parameters:

NameTypeOptionalDescription
keystringNo
valueGuildNo

Released under the Apache-2.0 License.