Skip to content

GuildInviteManager

GuildInviteManager ⇐ Base

Represents a manager for handling guild invites.

Kind: global class
Extends: Base

new GuildInviteManager(guild, client)

Constructs a new instance of the class.

ParamTypeDescription
guildGuildThe guild associated with the invite manager.
clientClientThe 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.

ParamTypeDefaultDescription
invitesstring | InviteThe invite code or Invite object to add.
[guild]Guildthis.guildThe guild to add the invite to.
[options]Object{cache: true, force: false}Additional options for adding the invite.
[options.cache]booleantrueWhether to cache the invite.
[options.force]booleanfalseWhether 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.

ParamTypeDescription
[options]ObjectOptional parameters for the fetch request.
[options.cache]booleanWhether to use cached data or not.
[options.force]booleanWhether 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.
ParamTypeDescription
invitestring | objectThe invitation code or object to delete.
reasonstringThe reason for deleting the invitation.