Skip to content

Commit

Permalink
refactor(User): remove bitfield getters and add displayName
Browse files Browse the repository at this point in the history
  • Loading branch information
ckohen committed Sep 3, 2024
1 parent 97ab4b6 commit 5315cda
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions packages/structures/src/users/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ export class User<Omitted extends keyof APIUser | '' = ''> extends Structure<API
return this[kData].global_name;
}

/**
* The name displayed in the client for this user when no nickname is set
*/
public get displayName() {
return this.globalName ?? this.username;
}

/**
* The user avatar's hash
*/
Expand Down Expand Up @@ -133,15 +140,6 @@ export class User<Omitted extends keyof APIUser | '' = ''> extends Structure<API
return this[kData].email;
}

/**
* The flags on the user's account
*
* @remarks This property is only set when the user was fetched with an OAuth2 token and the `identity` scope
*/
public get flags() {
return this[kData].flags;
}

/**
* The type of nitro subscription on the user's account
*
Expand All @@ -151,13 +149,6 @@ export class User<Omitted extends keyof APIUser | '' = ''> extends Structure<API
return this[kData].premium_type;
}

/**
* The public flags for the user
*/
public get publicFlags() {
return this[kData].public_flags;
}

/**
* The user's avatar decoration hash
*/
Expand Down

0 comments on commit 5315cda

Please sign in to comment.