GuildIntegrationManager
GuildIntegrationManager ⇐ Base
Section titled “GuildIntegrationManager ⇐ Base”Represents a manager for guild integrations.
Kind: global class
Extends: Base
- GuildIntegrationManager ⇐
Base- new GuildIntegrationManager(guildId, client)
- .cache ⇒
- ._add(integrations, [guildId], [options]) ⇒
Integration|null - .fetch([options], [guild]) ⇒
Promise.<Cache> - .delete(options, reason) ⇒
Promise
new GuildIntegrationManager(guildId, client)
Section titled “new GuildIntegrationManager(guildId, client)”Constructs a new instance of the class.
| Param | Type | Description |
|---|---|---|
| guildId | string | The ID of the guild. |
| client | Client | The client instance. |
guildIntegrationManager.cache ⇒
Section titled “guildIntegrationManager.cache ⇒”Getter method for the cache property.
Kind: instance property of GuildIntegrationManager
Returns: The Collection object representing the cache.
guildIntegrationManager._add(integrations, [guildId], [options]) ⇒ Integration | null
Section titled “guildIntegrationManager._add(integrations, [guildId], [options]) ⇒ Integration | null”Adds an integration to the guild.
Kind: instance method of GuildIntegrationManager
Returns: Integration | null - - The added integration or null if integrations is falsy.
| Param | Type | Default | Description |
|---|---|---|---|
| integrations | string | Integration | The integration ID or the integration object. | |
| [guildId] | string | ”this.guildId” | The ID of the guild to add the integration to. |
| [options] | object | {cache: true, force: false} | Additional options for adding the integration. |
| [options.cache] | boolean | true | Whether to cache the integration. |
| [options.force] | boolean | false | Whether to force adding the integration even if it is already cached. |
guildIntegrationManager.fetch([options], [guild]) ⇒ Promise.<Cache>
Section titled “guildIntegrationManager.fetch([options], [guild]) ⇒ Promise.<Cache>”Fetches the integrations for a guild.
Kind: instance method of GuildIntegrationManager
Returns: Promise.<Cache> - - A promise that resolves to a cache object containing the fetched integrations.
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | Optional parameters for the fetch request. | |
| [options.cache] | boolean | Whether to cache the fetched data. | |
| [options.force] | boolean | Whether to force the fetch request even if the data is already cached. | |
| [guild] | string | Guild | ”this.guildId” | The guild to fetch integrations for. Defaults to the current guild. |
guildIntegrationManager.delete(options, reason) ⇒ Promise
Section titled “guildIntegrationManager.delete(options, reason) ⇒ Promise”Deletes an integration from a guild.
Kind: instance method of GuildIntegrationManager
Returns: Promise - A promise that resolves when the integration is deleted and the deleted integration is added to the list of deleted integrations.
| Param | Type | Description |
|---|---|---|
| options | Object | The options for deleting the integration. |
| options.guild | string | The ID of the guild where the integration is located. |
| options.integration | string | The ID of the integration to delete. |
| reason | string | The reason for deleting the integration. |