Skip to content

Invite

classe · Source

Represents an invitation to a guild channel.

Extends: Base

Properties

guild

nullable

guild: Guild | InviteGuild

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

code

code: string

The code for this invite Source

presenceCount

nullable

presenceCount: number

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

memberCount

nullable

memberCount: number

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

temporary

nullable

temporary: boolean

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

maxAge

nullable

maxAge: number

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

uses

nullable

uses: number

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

maxUses

nullable

maxUses: number

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

inviterId

nullable

inviterId: Snowflake

The user's id who created this invite Source

inviter

nullable

inviter: User

The user who created this invite Source

targetUser

nullable

targetUser: User

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

targetApplication

nullable

targetApplication: IntegrationApplication

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

targetType

nullable

targetType: TargetType

The target type Source

type

nullable

type: InviteType

The type of invite Source

channelId

nullable

channelId: Snowflake

The channel's id this invite is for Source

channel

nullable

channel: Channel

The channel this invite is for Source

createdTimestamp

nullable

createdTimestamp: number

The timestamp this invite was created at Source

stageInstance

nullable

stageInstance: InviteStageInstance

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

guildScheduledEvent

nullable

guildScheduledEvent: GuildScheduledEvent

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

flags

nullable

flags: Readonly<InviteFlags>

The flags that are applied to the invite. Source

roles

roles: Array<Role>

Partial roles assigned when this invite is accepted. Source

createdAt

readonly · nullable

createdAt: Date

The time the invite was created at Source

deletable

readonly

deletable: boolean

Whether the invite is deletable by the client user Source

expiresTimestamp

readonly · nullable

expiresTimestamp: number

The timestamp the invite will expire at Source

expiresAt

readonly · nullable

expiresAt: Date

The time the invite will expire at Source

url

readonly

url: string

The URL to the invite Source

client

readonly

client: Client

The client that instantiated this Source

INVITES_PATTERN

static

INVITES_PATTERN: RegExp

Regular expression that globally matches Discord invite links Source

Methods

delete

async

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

Deletes this invite. Parameters

NameTypeDescription
reason?stringReason for deleting this invite

Returns: Promise<Invite>Source

toString

toString(): string

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

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

Source

Unofficial software. Not affiliated with or supported by Discord.