Skip to content

Commit

Permalink
fix(User): set User#bot to false if not partial (#4706)
Browse files Browse the repository at this point in the history
Co-authored-by: Noel <icrawltogo@gmail.com>
  • Loading branch information
vaporoxx and iCrawl committed Aug 15, 2020
1 parent 5249cf3 commit db512d8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/structures/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit db512d8

Please sign in to comment.