class GuildInvite

export class GuildInvite<WithCounts extends boolean = boolean> extends BaseInvite<WithCounts>

A channel invite leading to a guild.

Type Parameters

optional
WithCounts? extends boolean = boolean

approximateMemberCount : WithCounts extends true ? number : null

The approximate total number of members.

Inherited from: BaseInvite

approximatePresenceCount : WithCounts extends true ? number : null

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

The channel this invite is for.

readonly
channelId : Snowflake | null

The id of the channel this invite is for.

Inherited from: BaseInvite

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

readonly
code : string

The invite code.

Inherited from: BaseInvite

readonly
createdAt : Date | null

The creation date of this invite.

Inherited from: BaseInvite

createdTimestamp : number | null

The timestamp this invite was created at.

Inherited from: BaseInvite

readonly
deletable : boolean

Whether the invite is deletable by the client user.

readonly
expiresAt : Date | null

The expiry date of this invite.

Inherited from: BaseInvite

readonly
expiresTimestamp : number | null

The timestamp this invite expires at.

Inherited from: BaseInvite

The flags of this invite.

guild : Guild | InviteGuild | null

The guild the invite is for. May include welcome screen data.

readonly
guildId : Snowflake

The id of the guild this invite is for.

guildScheduledEvent : GuildScheduledEvent | null

The guild scheduled event data if there is a GuildScheduledEvent in the channel.

readonly
inviter : User | null

The user that created this invite.

Inherited from: BaseInvite

readonly
inviterId : Snowflake | null

The id of the user that created this invite.

Inherited from: BaseInvite

static
InvitesPattern : RegExp

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

Inherited from: BaseInvite

maxAge : number | null

The maximum age of the invite in seconds. 0 for no expiry.

Inherited from: BaseInvite

maxUses : number | null

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

The roles assigned to the user upon accepting the invite.

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 this invite grants temporary membership. This is only available when the invite was fetched through fetch or created through create.

readonly
type : InviteType.Guild

The type of this invite.

readonly
url : string

The URL to the invite.

Inherited from: BaseInvite

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<void>

Delete 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/djs
console.log(`Invite: ${invite}`);

Inherited from: BaseInvite

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

Update target users of this invite.

valueOf() : string

Inherited from: Base