mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Reduce memory usage by dynamically creating Dates
This commit is contained in:
@@ -47,12 +47,7 @@ class Invite {
|
||||
* @type {String}
|
||||
*/
|
||||
this.code = data.code;
|
||||
|
||||
/**
|
||||
* The creation date of the invite
|
||||
* @type {Date}
|
||||
*/
|
||||
this.creationDate = new Date(data.created_at);
|
||||
this._creationDate = new Date(data.created_at).getTime();
|
||||
|
||||
/**
|
||||
* Whether or not this invite is temporary
|
||||
@@ -93,6 +88,14 @@ class Invite {
|
||||
this.channels = this.client.channels.get(data.channel.id) || new PartialGuildChannel(this.client, data.channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* The creation date of the invite
|
||||
* @type {Date}
|
||||
*/
|
||||
get creationDate() {
|
||||
return new Date(this._creationDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes this invite
|
||||
* @returns {Promise<Invite, Error>}
|
||||
|
||||
Reference in New Issue
Block a user