Fix user.bot (#2073)

* fix user.bot

* user.avatar is nullable (docs)
This commit is contained in:
bdistin
2017-10-28 11:58:27 -05:00
committed by Crawl
parent cda408534a
commit b255af0825

View File

@@ -20,6 +20,13 @@ class User extends Base {
*/
this.id = data.id;
/**
* Whether or not the user is a bot
* @type {boolean}
* @name User#bot
*/
this.bot = Boolean(data.bot);
this._patch(data);
}
@@ -40,18 +47,11 @@ class User extends Base {
/**
* The ID of the user's avatar
* @type {string}
* @type {?string}
* @name User#avatar
*/
if (typeof data.avatar !== 'undefined') this.avatar = data.avatar;
/**
* Whether or not the user is a bot
* @type {boolean}
* @name User#bot
*/
if (typeof this.bot === 'undefined' && typeof data.bot !== 'undefined') this.bot = Boolean(data.bot);
/**
* The ID of the last message sent by the user, if one was sent
* @type {?Snowflake}