2024-06-21 07:47:03 +01:00
|
|
|
import { Client } from '../client/client.js';
|
2024-06-19 22:13:16 +01:00
|
|
|
import { parseText as parseEmojis } from '../emoji.js';
|
2024-06-17 21:17:27 +01:00
|
|
|
|
|
|
|
export default class User {
|
|
|
|
id;
|
|
|
|
nickname;
|
|
|
|
username;
|
|
|
|
host;
|
|
|
|
avatar_url;
|
|
|
|
emojis;
|
2024-06-21 06:52:34 +01:00
|
|
|
url;
|
2024-06-17 21:17:27 +01:00
|
|
|
|
|
|
|
get name() {
|
|
|
|
return this.nickname || this.username;
|
|
|
|
}
|
|
|
|
|
|
|
|
get mention() {
|
|
|
|
let res = "@" + this.username;
|
2024-06-21 07:47:03 +01:00
|
|
|
if (this.host != Client.get().instance.host)
|
|
|
|
res += "@" + this.host;
|
2024-06-17 21:17:27 +01:00
|
|
|
return res;
|
|
|
|
}
|
2024-06-19 22:13:16 +01:00
|
|
|
|
|
|
|
get rich_name() {
|
|
|
|
if (!this.nickname) return this.username;
|
|
|
|
return parseEmojis(this.nickname, this.host);
|
|
|
|
}
|
2024-06-17 21:17:27 +01:00
|
|
|
}
|