mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix(User): set User#bot to false if not partial (#4706)
Co-authored-by: Noel <icrawltogo@gmail.com>
This commit is contained in:
parent
5249cf33e5
commit
db512d8f62
1 changed files with 7 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue