fix: set #nickname to null as the default value (#4641)

This commit is contained in:
Souvik
2020-08-12 00:28:52 +05:30
committed by GitHub
parent 3df99930e8
commit 2adb5815bf

View File

@@ -66,16 +66,18 @@ class GuildMember extends Base {
*/
this.deleted = false;
this._roles = [];
if (data) this._patch(data);
}
_patch(data) {
/**
* The nickname of this member, if they have one
* @type {?string}
* @name GuildMember#nickname
*/
this.nickname = null;
this._roles = [];
if (data) this._patch(data);
}
_patch(data) {
if (typeof data.nick !== 'undefined') this.nickname = data.nick;
if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();