GuildInviteManager

export class GuildInviteManager extends DataManager<string, Invite, InviteResolvable>
export class GuildInviteManager extends DataManager<string, Invite, InviteResolvable>
Manages API methods for GuildInvites and stores their cache.
Readonly
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
The data structure belonging to this manager.
Inherited from DataManager
create(channel, options?):Promise<Invite>
Create an invite to the guild from the provided channel.
Example
// Create an invite to a selected channel
guild.invites.create('599942732013764608')
.then(console.log)
.catch(console.error);
// Create an invite to a selected channel
guild.invites.create('599942732013764608')
.then(console.log)
.catch(console.error);
NameTypeOptionalDescription
channelGuildInvitableChannelResolvableNoThe options for creating the invite from a channel.
optionsInviteCreateOptionsYesThe options for creating the invite from a channel.
delete(invite, reason?):Promise<Invite>
Deletes an invite.
NameTypeOptionalDescription
inviteInviteResolvableNoThe invite to delete
reasonstringYesReason for deleting the invite
fetch(options):Promise<Invite>
Fetches invite(s) from Discord.
Example
// Fetch all invites from a guild
guild.invites.fetch()
.then(console.log)
.catch(console.error);
// Fetch all invites from a guild
guild.invites.fetch()
.then(console.log)
.catch(console.error);
Example
// Fetch all invites from a guild without caching
guild.invites.fetch({ cache: false })
.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);
Example
// Fetch all invites from a channel
guild.invites.fetch({ channelId: '222197033908436994' })
.then(console.log)
.catch(console.error);
// Fetch all invites from a channel
guild.invites.fetch({ channelId: '222197033908436994' })
.then(console.log)
.catch(console.error);
Example
// Fetch a single invite
guild.invites.fetch('bRCvFy9')
.then(console.log)
.catch(console.error);
// Fetch a single invite
guild.invites.fetch('bRCvFy9')
.then(console.log)
.catch(console.error);
Example
// 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 checking cache
guild.invites.fetch({ code: 'bRCvFy9', force: true })
.then(console.log)
.catch(console.error)
Example
// Fetch a single invite without caching
guild.invites.fetch({ code: 'bRCvFy9', cache: false })
.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);
NameTypeOptionalDescription
optionsInviteResolvable | FetchInviteOptionsNoOptions for fetching guild invite(s)
resolve(invite):Invite | null
Resolves an InviteResolvable to an Invite object.
NameTypeOptionalDescription
inviteInviteResolvableNoThe invite resolvable to resolve
resolveId(invite):string | null
Resolves an InviteResolvable to an invite code string.
NameTypeOptionalDescription
inviteInviteResolvableNoThe invite resolvable to resolve