mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Reduce memory usage by dynamically creating Dates
This commit is contained in:
@@ -59,11 +59,7 @@ class GuildMember {
|
||||
* @type {?String}
|
||||
*/
|
||||
this.voiceChannelID = data.channel_id;
|
||||
/**
|
||||
* The date this member joined the guild
|
||||
* @type {Date}
|
||||
*/
|
||||
this.joinDate = new Date(data.joined_at);
|
||||
this._joinDate = new Date(data.joined_at).getTime();
|
||||
/**
|
||||
* Whether this meember is speaking
|
||||
* @type {?Boolean}
|
||||
@@ -77,6 +73,14 @@ class GuildMember {
|
||||
this._roles = data.roles;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date this member joined the guild
|
||||
* @type {Date}
|
||||
*/
|
||||
get joinDate() {
|
||||
return new Date(this._joinDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of roles that are applied to this GuildMember
|
||||
* @type {Array<Role>}
|
||||
|
||||
Reference in New Issue
Block a user