GuildInviteManager
GuildInviteManager ⇐ Base
Represents a manager for handling guild invites.
Kind: global class
Extends: Base
- GuildInviteManager ⇐
Base
- new GuildInviteManager(guild, client)
- .cache ⇒
- ._add(invites, [guild], [options]) ⇒
Invite
|null
- .fetch([options]) ⇒
Promise.<CacheConstructor>
- .delete(invite, reason) ⇒
Promise
new GuildInviteManager(guild, client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
guild | Guild | The guild associated with the invite manager. |
client | Client | The client instance. |
guildInviteManager.cache ⇒
Getter method for the cache property.
Kind: instance property of GuildInviteManager
Returns: The Collection object representing the cache.
guildInviteManager._add(invites, [guild], [options]) ⇒ Invite
| null
Adds an invite to the guild’s invite cache.
Kind: instance method of GuildInviteManager
Returns: Invite
| null
- The added invite or null if no invite is provided.
Param | Type | Default | Description |
---|---|---|---|
invites | string | Invite | The invite code or Invite object to add. | |
[guild] | Guild | this.guild | The guild to add the invite to. |
[options] | Object | {cache: true, force: false} | Additional options for adding the invite. |
[options.cache] | boolean | true | Whether to cache the invite. |
[options.force] | boolean | false | Whether to force the retrieval of the invite from the cache. |
guildInviteManager.fetch([options]) ⇒ Promise.<CacheConstructor>
Fetches guild invites from the API and returns a new cache constructor with the fetched data.
Kind: instance method of GuildInviteManager
Returns: Promise.<CacheConstructor>
- A promise that resolves to a new cache constructor with the fetched data.
Param | Type | Description |
---|---|---|
[options] | Object | Optional parameters for the fetch request. |
[options.cache] | boolean | Whether to use cached data or not. |
[options.force] | boolean | Whether to force a fresh fetch or not. |
guildInviteManager.delete(invite, reason) ⇒ Promise
Deletes an invitation with the specified code and reason.
Kind: instance method of GuildInviteManager
Returns: Promise
- A promise that resolves with the deleted invitation.
Throws:
RangeError
If no invitation code is specified.
Param | Type | Description |
---|---|---|
invite | string | object | The invitation code or object to delete. |
reason | string | The reason for deleting the invitation. |