mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(User): set User#bot to false if not partial (#4706)
Co-authored-by: Noel <icrawltogo@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user