mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 01:01:30 +00:00
fix(ClientUser): verified and enabled properties resetting (#3733)
* fix(ClientUser) verified and enabled properties resetting * set this.mfaEnabled to null if it is undefined * add missing curly brackets * fix typo
This commit is contained in:
parent
90aa5b3500
commit
3ea9ac57dd
1 changed files with 16 additions and 10 deletions
|
|
@ -16,17 +16,23 @@ class ClientUser extends Structures.get('User') {
|
||||||
_patch(data) {
|
_patch(data) {
|
||||||
super._patch(data);
|
super._patch(data);
|
||||||
|
|
||||||
/**
|
if ('verified' in data) {
|
||||||
* Whether or not this account has been verified
|
/**
|
||||||
* @type {boolean}
|
* Whether or not this account has been verified
|
||||||
*/
|
* @type {boolean}
|
||||||
this.verified = data.verified;
|
*/
|
||||||
|
this.verified = data.verified;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
if ('mfa_enabled' in data) {
|
||||||
* If the bot's {@link ClientApplication#owner Owner} has MFA enabled on their account
|
/**
|
||||||
* @type {?boolean}
|
* If the bot's {@link ClientApplication#owner Owner} has MFA enabled on their account
|
||||||
*/
|
* @type {?boolean}
|
||||||
this.mfaEnabled = typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null;
|
*/
|
||||||
|
this.mfaEnabled = typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null;
|
||||||
|
} else if (typeof this.mfaEnabled === 'undefined') {
|
||||||
|
this.mfaEnabled = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (data.token) this.client.token = data.token;
|
if (data.token) this.client.token = data.token;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue