mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: set #nickname to null as the default value (#4641)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user