Preview environment

class GuildInviteManager

export class GuildInviteManager extends DataManager<string, Invite, InviteResolvable>

Manages API methods for GuildInvites and stores their cache.

readonly
cache : Collection<string, Invite>

The cache of items for this manager.

Inherited from: DataManager

readonly
client : Client

The client that instantiated this Manager

Inherited from: BaseManager

guild : Guild

The guild this Manager belongs to

readonly
holds : Constructable<Invite>

The data structure belonging to this manager.

Inherited from: DataManager

Create an invite to the guild from the provided channel.

Examples:
// Create an invite to a selected channel
guild.invites.create('599942732013764608')
  .then(console.log)
  .catch(console.error);

delete(
reason?: string
) : Promise<Invite>

Deletes an invite.

Fetches invite(s) from Discord.

Examples:
// Fetch all invites from a guild
guild.invites.fetch()
  .then(console.log)
  .catch(console.error);
// Fetch all invites from a guild without caching
guild.invites.fetch({ cache: false })
  .then(console.log)
  .catch(console.error);
// Fetch all invites from a channel
guild.invites.fetch({ channelId: '222197033908436994' })
  .then(console.log)
  .catch(console.error);
// Fetch a single invite
guild.invites.fetch('bRCvFy9')
  .then(console.log)
  .catch(console.error);
// Fetch a single invite without checking cache
guild.invites.fetch({ code: 'bRCvFy9', force: true })
  .then(console.log)
  .catch(console.error)
// Fetch a single invite without caching
guild.invites.fetch({ code: 'bRCvFy9', cache: false })
  .then(console.log)
  .catch(console.error);

resolve() : Invite | null

Resolves an InviteResolvable to an Invite object.

resolveId() : string | null

Resolves an InviteResolvable to an invite code string.

valueOf() : Collection<string, Invite>

Inherited from: DataManager