Skip to content

GuildDiscoveryManager

GuildDiscoveryManager ⇐ Base

Represents a manager for guild discovery settings.

Kind: global class
Extends: Base

new GuildDiscoveryManager(guildId, client)

Constructs a new instance of the class.

ParamTypeDescription
guildIdstringThe ID of the guild.
clientClientThe 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.

ParamTypeDescription
discoverystring | GuildDiscoveryThe 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.
ParamTypeDefaultDescription
[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.
ParamTypeDescription
guildstring | GuildThe guild ID or guild object to edit the discovery metadata for.
optionsObjectThe 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.

ParamTypeDescription
payloadObjectThe payload object to transform.