Invite
Defined in: packages/structures/src/resources.ts:356
A Discord invite link and its metadata.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Invite(
data):Invite
Defined in: packages/structures/src/resources.ts:379
Creates an invite from Discord data.
Parameters
Section titled “Parameters”channel?
Section titled “channel?”{ id: string; } | null
string
created_at?
Section titled “created_at?”string | null
expires_at?
Section titled “expires_at?”string | null
guild?
Section titled “guild?”{ id: string; } | null
inviter?
Section titled “inviter?”{ avatar?: string | null; bot?: boolean; discriminator?: string; global_name?: string | null; id: string; public_flags?: number; system?: boolean; username: string; } | null
max_age?
Section titled “max_age?”number
max_uses?
Section titled “max_uses?”number
temporary?
Section titled “temporary?”boolean
number
Returns
Section titled “Returns”Invite
Properties
Section titled “Properties”channelId
Section titled “channelId”
readonlychannelId:string|null
Defined in: packages/structures/src/resources.ts:362
Channel this invite points to, if any.
readonlycode:string
Defined in: packages/structures/src/resources.ts:358
Invite code (the unique part of the URL).
createdAt
Section titled “createdAt”
readonlycreatedAt:Date|null
Defined in: packages/structures/src/resources.ts:374
When the invite was created.
expiresAt
Section titled “expiresAt”
readonlyexpiresAt:Date|null
Defined in: packages/structures/src/resources.ts:376
When the invite expires, or null if it never expires.
guildId
Section titled “guildId”
readonlyguildId:string|null
Defined in: packages/structures/src/resources.ts:360
Guild this invite belongs to, if any.
inviter
Section titled “inviter”
readonlyinviter:User|null
Defined in: packages/structures/src/resources.ts:364
User who created the invite, if available.
maxAge
Section titled “maxAge”maxAge:
number
Defined in: packages/structures/src/resources.ts:370
Duration in seconds until the invite expires (0 = never).
maxUses
Section titled “maxUses”maxUses:
number
Defined in: packages/structures/src/resources.ts:368
Maximum number of uses (0 = unlimited).
temporary
Section titled “temporary”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.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get url():
string
Defined in: packages/structures/src/resources.ts:414
The full invite URL.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”toString()
Section titled “toString()”toString():
string
Defined in: packages/structures/src/resources.ts:419
Returns the invite URL. Used automatically in template literals.
Returns
Section titled “Returns”string