Skip to content

Commit

Permalink
fix(GuildMember): account for joinedTimestamp as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewdcario committed Jun 6, 2018
1 parent 13bfceb commit 5071477
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/structures/GuildMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ class GuildMember extends Base {
*/
this.user = {};

/**
* The timestamp the member joined the guild at
* @type {?number}
* @name GuildMember#joinedTimestamp
*/
this.joinedTimestamp = null;

/**
* The ID of the last message sent by the member in their guild, if one was sent
* @type {?Snowflake}
Expand Down Expand Up @@ -64,11 +71,6 @@ class GuildMember extends Base {
*/
if (typeof data.nick !== 'undefined') this.nickname = data.nick;

/**
* The timestamp the member joined the guild at, if the data was received
* @type {?number}
* @name GuildMember#joinedTimestamp
*/
if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();

if (data.user) this.user = this.guild.client.users.add(data.user);
Expand Down Expand Up @@ -147,7 +149,7 @@ class GuildMember extends Base {
get voiceChannelID() { return this.voiceState.channel_id; }

/**
* The time this member joined the guild, if the data was received
* The time this member joined the guild
* @type {?Date}
* @readonly
*/
Expand Down

0 comments on commit 5071477

Please sign in to comment.