Invite

Invite

Represents a guild invite.

Constructor

new Invite(client, data, options)

Description:
  • Creates the structure for an invite.

Source:
See:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The raw invite data from Discord.

options Object

Additional options for this structure.

Properties
Name Type Attributes Description
guildId String

The id of the guild that the invite belongs to.

nocache Boolean <nullable>

Whether this invite should be cached or not.

Members

(readonly, nullable) channel :TextChannel|VoiceChannel

Description:
  • The channel the invite is directed to.

Source:

The channel the invite is directed to.

Type:

(readonly) channelId :String

Description:
  • The id of the channel the invite is directed to.

Source:

The id of the channel the invite is directed to.

Type:
  • String

(readonly) code :String

Description:
  • The code of the invite.

Source:

The code of the invite.

Type:
  • String

(readonly, nullable) expires :Number

Description:
  • The UNIX timestamp of when the invite expires.

Source:

The UNIX timestamp of when the invite expires.

Type:
  • Number

(readonly, nullable) guild :Guild

Description:
  • The guild that this role belongs to.

Source:

The guild that this role belongs to.

Type:

(readonly) guildId :String

Description:
  • The id of the guild that this invite belongs to.

Source:

The id of the guild that this invite belongs to.

Type:
  • String

(readonly) id :String

Description:
  • The code of the invite.

Source:

The code of the invite.

Type:
  • String

(readonly, nullable) inviter :User

Description:
  • The user who created the invite.

Source:

The user who created the invite.

Type:

(readonly, nullable) maxUses :Number

Description:
  • The maximum number of uses allowed for the invite.

Source:

The maximum number of uses allowed for the invite.

Type:
  • Number

(readonly) url :String

Description:
  • The URL of the invite.

Source:

The URL of the invite.

Type:
  • String

(readonly, nullable) uses :Number

Description:
  • The number of times the invite has been used.

Source:

The number of times the invite has been used.

Type:
  • Number

Methods

(static) getUrl(code) → {String}

Description:
  • Returns the URL of the invite.

Source:
Parameters:
Name Type Description
code String

The code of the invite.

Returns:
Type
String

(static) shouldCache(gluonCacheOptions, guildCacheOptions) → {Boolean}

Description:
  • Determines whether the invite should be cached.

Source:
Parameters:
Name Type Description
gluonCacheOptions GluonCacheOptions

The cache options for the client.

guildCacheOptions GuildCacheOptions

The cache options for the guild.

Returns:
Type
Boolean

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: