1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-26 07:19:23 +00:00
comunicapiv2/src/entities/CustomEmoji.ts
2020-04-29 16:57:12 +02:00

36 lines
619 B
TypeScript

/**
* Custom smiley
*
* @author Pierre Hubert
*/
import { pathUserData } from "../utils/UserDataUtils";
export interface CustomEmojiBuilder {
id: number,
userID: number,
shortcut: string,
path: string,
}
export class CustomEmoji implements CustomEmojiBuilder {
id: number;
userID: number;
shortcut: string;
path: string;
public constructor(info: CustomEmojiBuilder) {
for (const key in info) {
if (info.hasOwnProperty(key))
this[key] = info[key];
}
}
get url() : string {
return pathUserData(this.path, false);
}
get sysPath() : string {
return pathUserData(this.path, true);
}
}