Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/structures/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ export default class User extends Base {
}
}

private get isMigrated(): boolean {
return this.globalName !== null && (this.discriminator === undefined || this.discriminator === "0");
}

/** The default avatar value of this user. */
get defaultAvatar(): number {
if (this.isMigrated) {
Expand All @@ -80,15 +76,20 @@ export default class User extends Base {
return Number(this.discriminator) % 5;
}

/** If this user has migrated to the new username system. */
get isMigrated(): boolean {
return this.globalName !== null && (this.discriminator === undefined || this.discriminator === "0");
}

/** A string that will mention this user. */
get mention(): string {
return `<@${this.id}>`;
}

/** This user's display name, if migrated, else a combination of the user's username and discriminator. */
/** This user's unique username, if migrated, else a combination of the user's username and discriminator. */
get tag(): string {
if (this.isMigrated) {
return this.globalName!;
return this.username;
}
return `${this.username}#${this.discriminator}`;
}
Expand Down