fix(Partials): correctly document properties for partialized st… (#3922)

* fix(Partials): properly document partial properties

* style: turn tabs into spaces

* style: order properties alphabetically

* fix(typings): PartialDMChannel will always have a recipient

* change properties to undefined instead of null

* docs: correctly mark properties

* style: remove tabs

* fix(partials): document properties properly

* style: tabs

* style: random line

* docs(User): tag is nullable

* typings(User/GuildMember): document lastMessageID properly

* typings/fix: change lastMessageID to lastMessageChannelID

Co-authored-by: Crawl <icrawltogo@gmail.com>
This commit is contained in:
Sugden
2020-03-17 17:59:47 +00:00
committed by GitHub
parent 8c0a940cdb
commit 8b906c69bb
2 changed files with 66 additions and 19 deletions

View File

@@ -38,14 +38,14 @@ class User extends Base {
_patch(data) {
/**
* The username of the user
* @type {string}
* @type {?string}
* @name User#username
*/
if (data.username) this.username = data.username;
/**
* A discriminator based on username for the user
* @type {string}
* @type {?string}
* @name User#discriminator
*/
if (data.discriminator) this.discriminator = data.discriminator;
@@ -166,11 +166,11 @@ class User extends Base {
/**
* The Discord "tag" (e.g. `hydrabolt#0001`) for this user
* @type {string}
* @type {?string}
* @readonly
*/
get tag() {
return `${this.username}#${this.discriminator}`;
return typeof this.username === 'string' ? `${this.username}#${this.discriminator}` : null;
}
/**