Skip to main content
An Invite is an invite to a server. You get one from channel.createInvite(), channel.fetchInvites() or guild.fetchInvites().
What createInvite() takes is in InviteCreateOptions. Which channels can create one is in Channels.

Properties

User | null
Who created the invite, when Discord says it.
string
The unique code of the invite (discord.gg/code).
string
The link to share.
Snowflake | null
The id of the server the invite leads to.
Snowflake | null
The id of the channel the invite leads to.
GuildChannel | null
The channel the invite leads to, when the bot knows it. It never sends a request.
Date | null
When the invite stops working; null when it never does.
number | null
How many times the invite was used, when Discord says it.
number | null
How many times the invite can be used; 0 means no limit.
boolean
Whether members who joined with it are kicked when they go offline.
An invite has no id and no createdAt: Discord identifies it by its code.

Helpers

These read what the bot remembers: they never send a request.

toString()

The link to share.

toJSON()

The data of Discord as a plain object, with camelCase names.

Actions

delete()

Deletes the invite: its link stops working. Discord documentation

Types

InviteCreateOptions is in Options.