Invite
- class Invite
A Discord invite and any metadata returned for it by the current endpoint. Count, expiration, and inviter-related fields may be absent depending on how the invite was obtained and which options were requested.
Properties
Property
Type
Description
approximateMemberCountApproximate member count at the time the invite was fetched, or
null.approximatePresenceCountApproximate online member count, or
null.channelPartial target channel information included with the invite.
channelIdChannel ID the invite targets, or
null.codeThe invite code used in discord.gg/ links.
createdAtWhen this invite was created, or
null.expiresAtWhen this invite expires, or
null.guildPartial target guild information included with the invite.
guildIdGuild ID the invite targets, or
null.inviterUser who created the invite when Discord includes it.
maxAgeDuration in seconds before the invite expires, or
null.maxUsesMaximum number of uses.
0means unlimited;nullmeans Discord omitted the field.targetApplicationTarget application metadata when Discord includes it.
targetTypeType of invite target, or
nullfor an ordinary channel invite.targetUserTarget user for stream or embedded-application invites.
temporaryIndicates whether this invite grants temporary membership, or
null.usesNumber of times this invite has been used, or
null.Methods
- async Invite.delete(reason: string) Promise<void>
Delete this invite.
- Parameters:
reason: Audit-log reason for deleting the invite.
-
async Invite.fetch() Promise<
Invite> Refetch the latest invite data from Discord.
- Returns:
The updated invite object.
-
async Invite.fetchChannel() Promise<
GuildTextChannel|GuildVoiceChannel| null> Fetch the full channel this invite points to. Only works for invites to the deployment’s own guild; for other servers it returns
null, andinvite.channelhas the public details Discord includes.