mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +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.deleted = false;
|
||||||
|
|
||||||
this._roles = [];
|
|
||||||
if (data) this._patch(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
_patch(data) {
|
|
||||||
/**
|
/**
|
||||||
* The nickname of this member, if they have one
|
* The nickname of this member, if they have one
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
* @name GuildMember#nickname
|
* @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 (typeof data.nick !== 'undefined') this.nickname = data.nick;
|
||||||
|
|
||||||
if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();
|
if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user