2023-03-04 08:54:01 +03:00
|
|
|
/* eslint-disable import/prefer-default-export */
|
|
|
|
export class User {
|
|
|
|
constructor(u) {
|
|
|
|
this.id = u.id;
|
|
|
|
this.displayName = u.displayName;
|
|
|
|
this.displayColor = u.displayColor;
|
|
|
|
this.createdAt = u.createdAt;
|
|
|
|
this.previousNames = u.previousNames;
|
|
|
|
this.nameChangedAt = u.nameChangedAt;
|
|
|
|
this.scopes = u.scopes;
|
|
|
|
this.authenticated = u.authenticated;
|
2023-05-31 23:28:06 +03:00
|
|
|
this.isBot = u.isBot;
|
|
|
|
|
|
|
|
if (this.scopes && this.scopes.length > 0) {
|
|
|
|
this.isModerator = this.scopes.includes('MODERATOR');
|
|
|
|
}
|
2023-03-04 08:54:01 +03:00
|
|
|
}
|
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
id: string;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
displayName: string;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
displayColor: number;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
createdAt: Date;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
previousNames: string[];
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
nameChangedAt: Date;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-04-30 01:09:53 +03:00
|
|
|
scopes: string[];
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2022-08-21 02:13:31 +03:00
|
|
|
authenticated: boolean;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2023-05-31 23:28:06 +03:00
|
|
|
isBot: boolean;
|
2023-03-04 08:54:01 +03:00
|
|
|
|
2023-05-31 23:28:06 +03:00
|
|
|
isModerator: boolean;
|
2022-04-30 01:09:53 +03:00
|
|
|
}
|