fix(user): support deleted accounts
This commit is contained in:
parent
756e43c56a
commit
960f994660
1 changed files with 2 additions and 1 deletions
|
@ -106,7 +106,7 @@ export class User {
|
|||
|
||||
/** User's or bot's first name */
|
||||
get firstName(): string {
|
||||
return this._user.firstName!
|
||||
return this._user.firstName ?? 'Deleted Account'
|
||||
}
|
||||
|
||||
/** User's or bot's last name */
|
||||
|
@ -251,6 +251,7 @@ export class User {
|
|||
* only first name otherwise.
|
||||
*/
|
||||
get displayName(): string {
|
||||
if (!this.firstName) return 'Deleted Account'
|
||||
if (this.lastName) return `${this.firstName} ${this.lastName}`
|
||||
return this.firstName
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue