fix(User): set User#bot to false if not partial (#4706)

Co-authored-by: Noel <icrawltogo@gmail.com>
This commit is contained in:
Jan
2020-08-15 20:04:32 +02:00
committed by GitHub
parent 5249cf33e5
commit db512d8f62

View File

@@ -30,15 +30,6 @@ class User extends Base {
}
_patch(data) {
if (typeof this.bot !== 'boolean') {
/**
* Whether or not the user is a bot
* @type {?boolean}
* @name User#bot
*/
this.bot = 'bot' in data ? Boolean(data.bot) : null;
}
if ('username' in data) {
/**
* The username of the user
@@ -50,6 +41,13 @@ class User extends Base {
this.username = null;
}
/**
* Whether or not the user is a bot
* @type {?boolean}
* @name User#bot
*/
this.bot = Boolean(data.bot);
if ('discriminator' in data) {
/**
* A discriminator based on username for the user