Skip to content

Commit

Permalink
fix(User): only assign to bot initially or if info is actually present (
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC authored Nov 20, 2020
1 parent 2e940e6 commit eaecd0e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/structures/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ class User extends Base {
this.username = null;
}

/**
* Whether or not the user is a bot
* @type {boolean}
*/
this.bot = Boolean(data.bot);
if ('bot' in data || typeof this.bot !== 'boolean') {
/**
* Whether or not the user is a bot
* @type {boolean}
*/
this.bot = Boolean(data.bot);
}

if ('discriminator' in data) {
/**
Expand Down

0 comments on commit eaecd0e

Please sign in to comment.