From eaecd0e8b790f218b2c52021b433c0957ec539c3 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Fri, 20 Nov 2020 16:48:05 +0100 Subject: [PATCH] fix(User): only assign to bot initially or if info is actually present (#4990) --- src/structures/User.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/structures/User.js b/src/structures/User.js index f99bf6d15..d2766f1c8 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -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) { /**