Skip to content

Invite

Defined in: packages/structures/src/resources.ts:356

A Discord invite link and its metadata.

new Invite(data): Invite

Defined in: packages/structures/src/resources.ts:379

Creates an invite from Discord data.

{ id: string; } | null

string

string | null

string | null

{ id: string; } | null

{ avatar?: string | null; bot?: boolean; discriminator?: string; global_name?: string | null; id: string; public_flags?: number; system?: boolean; username: string; } | null

number

number

boolean

number

Invite

readonly channelId: string | null

Defined in: packages/structures/src/resources.ts:362

Channel this invite points to, if any.


readonly code: string

Defined in: packages/structures/src/resources.ts:358

Invite code (the unique part of the URL).


readonly createdAt: Date | null

Defined in: packages/structures/src/resources.ts:374

When the invite was created.


readonly expiresAt: Date | null

Defined in: packages/structures/src/resources.ts:376

When the invite expires, or null if it never expires.


readonly guildId: string | null

Defined in: packages/structures/src/resources.ts:360

Guild this invite belongs to, if any.


readonly inviter: User | null

Defined in: packages/structures/src/resources.ts:364

User who created the invite, if available.


maxAge: number

Defined in: packages/structures/src/resources.ts:370

Duration in seconds until the invite expires (0 = never).


maxUses: number

Defined in: packages/structures/src/resources.ts:368

Maximum number of uses (0 = unlimited).


temporary: boolean

Defined in: packages/structures/src/resources.ts:372

Whether the invite is temporary (kicks uninducted members on disconnect).


uses: number

Defined in: packages/structures/src/resources.ts:366

Number of times the invite has been used.

get url(): string

Defined in: packages/structures/src/resources.ts:414

The full invite URL.

string

toString(): string

Defined in: packages/structures/src/resources.ts:419

Returns the invite URL. Used automatically in template literals.

string