2023-03-04 06:54:01 +01: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 22:28:06 +02:00
|
|
|
this.isBot = u.isBot;
|
|
|
|
|
|
|
|
if (this.scopes && this.scopes.length > 0) {
|
|
|
|
this.isModerator = this.scopes.includes('MODERATOR');
|
|
|
|
}
|
2023-03-04 06:54:01 +01:00
|
|
|
}
|
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
id: string;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
displayName: string;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
displayColor: number;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
createdAt: Date;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
previousNames: string[];
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
nameChangedAt: Date;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-04-30 00:09:53 +02:00
|
|
|
scopes: string[];
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2022-08-21 01:13:31 +02:00
|
|
|
authenticated: boolean;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2023-05-31 22:28:06 +02:00
|
|
|
isBot: boolean;
|
2023-03-04 06:54:01 +01:00
|
|
|
|
2023-05-31 22:28:06 +02:00
|
|
|
isModerator: boolean;
|
2022-04-30 00:09:53 +02:00
|
|
|
}
|