GuildDiscoveryManager
GuildDiscoveryManager ⇐ Base
Represents a manager for guild discovery settings.
Kind: global class
Extends: Base
- GuildDiscoveryManager ⇐
Base
- new GuildDiscoveryManager(guildId, client)
- instance
- ._add(discovery) ⇒
GuildDiscovery
|null
- .fetch([guild]) ⇒
Promise.<DiscoveryMetadata>
- .edit(guild, options) ⇒
Promise
- ._add(discovery) ⇒
- static
- .transformPayload(payload) ⇒
Object
- .transformPayload(payload) ⇒
new GuildDiscoveryManager(guildId, client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
guildId | string | The ID of the guild. |
client | Client | The client object. |
guildDiscoveryManager._add(discovery) ⇒ GuildDiscovery
| null
Adds a GuildDiscovery object to the guild’s discovery settings.
Kind: instance method of GuildDiscoveryManager
Returns: GuildDiscovery
| null
- - The added GuildDiscovery object or null if discovery is falsy.
Param | Type | Description |
---|---|---|
discovery | string | GuildDiscovery | The discovery object or the guild ID. |
guildDiscoveryManager.fetch([guild]) ⇒ Promise.<DiscoveryMetadata>
Fetches the discovery metadata for a guild.
Kind: instance method of GuildDiscoveryManager
Returns: Promise.<DiscoveryMetadata>
- - A promise that resolves to the discovery metadata.
Throws:
RangeError
- If the guild ID is not provided.
Param | Type | Default | Description |
---|---|---|---|
[guild] | string | Guild | ”this.guildId” | The guild ID or Guild object to fetch the metadata for. |
guildDiscoveryManager.edit(guild, options) ⇒ Promise
Edits the discovery metadata for a guild.
Kind: instance method of GuildDiscoveryManager
Returns: Promise
- A promise that resolves with the updated discovery metadata.
Throws:
RangeError
If the guild is not provided.
Param | Type | Description |
---|---|---|
guild | string | Guild | The guild ID or guild object to edit the discovery metadata for. |
options | Object | The options to update the discovery metadata. |
GuildDiscoveryManager.transformPayload(payload) ⇒ Object
Transforms the given payload object into a new object with specific properties.
Kind: static method of GuildDiscoveryManager
Returns: Object
- - The transformed object.
Param | Type | Description |
---|---|---|
payload | Object | The payload object to transform. |