class Invite

extends

Base
export class Invite extends Base

Represents an invitation to a guild channel.

The channel this invite is for

channelId : Snowflake | null

The id of the channel this invite is for

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

code : string

The code for this invite

readonly
createdAt : Date | null

The time the invite was created at

createdTimestamp : number | null

The timestamp this invite was created at

readonly
deletable : boolean

Whether the invite is deletable by the client user

readonly
expiresAt : Date | null

The time the invite will expire at

readonly
expiresTimestamp : number | null

The timestamp the invite will expire at

The flags of this invite.

guild : InviteGuild | Guild | null

The guild the invite is for including welcome screen data if present

guildScheduledEvent : GuildScheduledEvent | null

The guild scheduled event data if there is a GuildScheduledEvent in the channel this invite is for

readonly
inviter : User | null

The user who created this invite

inviterId : Snowflake | null

The user's id who created this invite

static
InvitesPattern : RegExp

A regular expression that matches Discord invite links. The code group property is present on the exec() result of this expression.

maxAge : number | null

The maximum age of the invite, in seconds, 0 if never expires This is only available when the invite was fetched through fetch or created through create.

maxUses : number | null

The maximum uses of this invite This is only available when the invite was fetched through fetch or created through create.

memberCount : number | null

The approximate total number of members of the guild this invite is for This is only available when the invite was fetched through fetchInvite.

presenceCount : number | null

The approximate number of online members of the guild this invite is for This is only available when the invite was fetched through fetchInvite.

The roles assigned to the user upon accepting the invite.

deprecated
stageInstance : InviteStageInstance | null

The stage instance data if there is a public StageInstance in the stage channel this invite is for

targetApplication : IntegrationApplication | null

The embedded application to open for this voice channel embedded application invite

targetType : InviteTargetType | null

The target type

targetUser : User | null

The user whose stream to display for this voice channel stream invite

temporary : boolean | null

Whether or not this invite only grants temporary membership This is only available when the invite was fetched through fetch or created through create.

type : InviteType

The type of this invite

readonly
url : string

The URL to the invite

uses : number | null

How many times this invite has been used This is only available when the invite was fetched through fetch or created through create.

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

Deletes this invite.

fetchTargetUsers() : Promise<Buffer>

Get target users of this invite.

fetchTargetUsersJobStatus() : Promise<TargetUsersJobStatusForInvite>

Get status of the job processing target users of this invite.

toJSON() : unknown

toString() : string

When concatenated with a string, this automatically concatenates the invite's URL instead of the object.

Examples:
// Logs: Invite: https://discord.gg/A1b2C3
console.log(`Invite: ${invite}`);

updateTargetUsers(
targetUsersFile: BufferResolvable | readonly UserResolvable[]
) : Promise<void>

Update target users of this invite.

valueOf() : string

Inherited from: Base