Made date/timestamps consistent and less shitty

This commit is contained in:
Schuyler Cebulskie
2016-09-27 19:46:53 -04:00
parent b6c26cc2ae
commit 1e57c968dd
10 changed files with 137 additions and 75 deletions

View File

@@ -82,9 +82,23 @@ class GuildMember {
*/
this.nickname = data.nick || null;
/**
* The timestamp the member joined the guild at
* @type {number}
*/
this.joinedTimestamp = new Date(data.joined_at).getTime();
this.user = data.user;
this._roles = data.roles;
this._joinDate = new Date(data.joined_at).getTime();
}
/**
* The time the member joined the guild
* @type {Date}
* @readonly
*/
get joinedAt() {
return new Date(this.joinedTimestamp);
}
/**
@@ -96,14 +110,6 @@ class GuildMember {
return this.guild.presences.get(this.id);
}
/**
* 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, mapped by the role ID.
* @type {Collection<string, Role>}