Invite class

const invite = new Invite(data: Invite, guild: Guild, addon: Addon);

constructor

The constructor of the Invite class requires three arguments. The first argument must be an instance of the Discord.js Invite class which provides the information about the invite. The second argument must be an instance of the Zyno Bot Addons Guild class and defines the guild where the invite was created for. The third argument must be an instance of the Zyno Bot Addons Addon class and is the addon where the Invite class must be created for.

Properties

code

The code of the invite (the characters behind the discord.gg/ or discord.com/invite/ url).

createdTimestamp

A number which represents the timestamp of the time when the invite was created.

created

An instance of the built-in NodeJS Date class which represents the time when the invite was created.

uses

The amount of times a member joined the server using this invite.

url

The url of the invite members can use to join the server.

guild

An instance of the Zyno Bot Addons Guild class which defines the guild where the invite was created for.

channel

An instance of the TextChannel, ForumChannel, VoiceChannel or StageChannel class which defines the channel where the invite was created for.

channelId

The id of the channel where the invite was created for.

deleteable

A boolean which defines whether the bot is able to delete the invite or not.

expiresTimestamp

A number which represents the timestamp of the time when the invite will automatically be deleted by Discord.

expires

An instance of the built-in NodeJS Date class which represents the time when the invite will automatically be deleted by Discord.

inviter

An instance of the Zyno Bot Addons Member class which represents the member who created the invite.

inviterId

The user id of the member who created the invite.

Functions

isDeleteable

invite.isDeletable() : boolean;

Returns a boolean which defines whether the bot is able to delete the invite or not.

delete

invite.delete() : Promise<void>;

Deletes the invite when the bot is able to delete the invite. The function returns a Promise which will be fulfilled once the invite has been deleted.

Last updated