Appearance
GuildManager
Package: @erinjs/core
Manages guilds with fetch. Extends Collection so you can use .get(), .set(), .filter(), etc.
Constructor
| Name | Type | Optional | Description |
|---|---|---|---|
client | Client | No |
Properties
| Name | Type | Readonly | Optional | Description |
|---|---|---|---|---|
maxSize | number | Yes | No |
Methods
create() async
Create a guild. POST /guilds.
Returns: Promise<Guild>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
options | { name: string; icon?: string | null; empty_features?: boolean; } | No | name (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:
| Name | Type | Optional | Description |
|---|---|---|---|
guildId | string | No | Snowflake 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:
| Name | Type | Optional | Description |
|---|---|---|---|
guildId | string | No | Snowflake of the guild |
set()
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
key | string | No | |
value | Guild | No |