forked from stoatchat/javascript-client-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserProfile.ts
More file actions
39 lines (33 loc) · 810 Bytes
/
Copy pathUserProfile.ts
File metadata and controls
39 lines (33 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import type { UserProfile as APIUserProfile } from "stoat-api";
import type { Client } from "../Client.js";
import { File } from "./File.js";
/**
* User Profile Class
*/
export class UserProfile {
readonly content?: string;
readonly banner?: File;
/**
* Construct Public Bot
* @param client Client
* @param data Data
*/
constructor(client: Client, data: APIUserProfile) {
this.content = data.content!;
this.banner = data.background
? new File(client, data.background)
: undefined;
}
/**
* URL to the user's banner
*/
get bannerURL(): string | undefined {
return this.banner?.createFileURL();
}
/**
* URL to the user's animated banner
*/
get animatedBannerURL(): string | undefined {
return this.banner?.createFileURL(true);
}
}