Results

Namespace

Type

An object representing an invite on Discord.

Invites typically appear as links (ex: discord.gg/6DbcNPz) where the code is a unique and random string of alpha-numeric characters.

Since Group DMs may create invites, some properties on the invite object are nullable.

Hierarchy

Index

Type aliases

Static ChannelData

ChannelData: object

Partial channel data present on channel data.

Type declaration

  • Readonly id: Snowflake

    The id of the discord.Channel this data represents.

  • Readonly name: string

    The name of the channel.

  • Readonly type: Type

    The type of channel the invite resolves to.

Static GuildData

GuildData: object

Partial guild data present on some invite data.

Type declaration

  • Readonly features: Array<Feature>

    A list of features available for this guild. See discord.Guild.features for more info.

  • Readonly icon: string | null

    The icon of the guild, if set. See discord.Guild.icon for more info.

  • Readonly id: Snowflake

    The id of the discord.Guild.

  • Readonly name: string

    The name of the guild.

  • Readonly splash: string | null

    The splash image hash of the guild, if set.

  • Readonly vanityUrlCode: string | null

    The vanity url invite code for this guild, if set.

  • Readonly verificationLevel: MFALevel

    The level of user account verification required to send messages in this guild without a role.

Properties

Readonly approximateMemberCount

approximateMemberCount: number | null

If the invite is for a guild channel, this number is the approximate total member count for the guild.

Requires that the invite was retrieved with [[discord.Invite.IGetGuildOptions.withCounts]] set to true.

Readonly approximatePresenceCount

approximatePresenceCount: number | null

If the invite is for a guild, this includes an approximate count of members online in the guild.

Requires that the invite was retrieved with [[discord.Invite.IGetGuildOptions.withCounts]] set to true.

Readonly channel

channel: ChannelData

Partial channel data for this invite.

Users who use this invite will be redirected to the channel id.

Readonly code

code: Snowflake

The unique identifier for this invite. May be used by user accounts to join a guild or group dm.

Readonly guild

guild: GuildData | null

Partial guild data for this invite, if relevant.

Readonly inviter

inviter: User | null

The user object who created this invite, if relevant.

Readonly targetUser

targetUser: User | null

A user that the invite targets.

Right now, this only indiicates if the invite is for a specific user's go-live stream in a guild's voice channel.

Readonly targetUserType

targetUserType: STREAM | null

If targetUser is set, this property specifies the type of invite and user this targets.

Right now, the only possible option is discord.Invite.TargetUserType.STREAM.

Methods

delete

  • delete(): Promise<void>
  • Tries to delete this invite. The bot user must be able to manage the channel or guild the invite belongs.

    If an error occurs, a discord.ApiError will be thrown.

    Returns Promise<void>

getChannel

  • getChannel(): Promise<AnyGuildChannel | null>
  • Attempts to retrieve the full Channel object for this invite.

    This function will return null if the channel does not belong to the guild the script is running in.

    Returns Promise<AnyGuildChannel | null>

getGuild

  • getGuild(): Promise<Guild | null>
  • Attempts to retrieve the full Guild object for this invite, if set.

    This function will also return null if the channel does not belong to the guild the script is running in.

    Returns Promise<Guild | null>

getUrl

  • getUrl(): string
  • Returns a url for the invite, in the format: https://discord.gg/<code>.

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc