Extends
Members
cache :Collection.<Snowflake, Guild>
The cache of this Manager
Type:
- Overrides:
- Source:
cacheType :Collection
The type of Collection of the Manager
Type:
- Collection
- Overrides:
- Source:
(readonly) client :Client
The client that instantiated this Manager
Type:
- Overrides:
- Source:
(private, readonly) holds :function
The data structure belonging to this manager
Type:
- function
- Overrides:
- Source:
Methods
(async) create(name, optionsopt) → {Promise.<Guild>}
Creates a guild.
This is only available to bots in fewer than 10 guilds.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | The name of the guild | |||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Options for the creating
Properties
|
- Source:
Returns:
The guild that was created
- Type
- Promise.<Guild>
(async) fetch(id, cacheopt, forceopt) → {Promise.<Guild>}
Obtains a guild from Discord, or the guild cache if it's already available.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
Snowflake | ID of the guild | ||
cache |
boolean |
<optional> |
true | Whether to cache the new guild object if it isn't already |
force |
boolean |
<optional> |
false | Whether to skip the cache check and request the API |
- Source:
Returns:
- Type
- Promise.<Guild>
Example
// Fetch a guild by its id
client.guilds.fetch('222078108977594368')
.then(guild => console.log(guild.name))
.catch(console.error);
resolve(guild) → {Guild}
Resolves a GuildResolvable to a Guild object.
Parameters:
Name | Type | Description |
---|---|---|
guild |
GuildResolvable | The guild resolvable to identify |
- Overrides:
- Source:
Returns:
- Type
- Guild
resolveID(guild) → {Snowflake}
Resolves a GuildResolvable to a Guild ID string.
Parameters:
Name | Type | Description |
---|---|---|
guild |
GuildResolvable | The guild resolvable to identify |
- Overrides:
- Source:
Returns:
- Type
- Snowflake