Files
discord-decomp/modules/activities/records/CustomActivityLinkRecord.tsx
T
2026-11-01 12:12:55 +02:00

30 lines
1.1 KiB
TypeScript

// Metro module 12282 (f12283).
import { decodeCustomActivityLink, CustomLinkType } from "../../../_bundle/Module12283";
import { getAssetImage } from "../../../utils/ApplicationAssetUtils";
import { getQuickLinkImage } from "../utils/CustomActivityLinkUtils";
class CustomActivityLinkRecord {
constructor(a0) {
const prototype = new.target.prototype;
let type = decodeCustomActivityLink(a0.link_id)?.type;
if (type == null) {
type = null;
}
const r15 = {
__proto__: prototype
};
r15.type = type;
r15.applicationId = a0.application_id;
r15.linkId = a0.link_id;
r15.assetId = "asset_id" in a0 ? a0.asset_id : void 0;
r15.assetPath = "asset_path" in a0 ? a0.asset_path : void 0;
r15.title = a0.title;
r15.description = a0.description;
r15.customId = a0.custom_id;
return r15;
}
getAssetURL() {
return this.type === CustomLinkType.MANAGED ? getAssetImage(this.applicationId, this.assetId, 512) : this.type === CustomLinkType.QUICK ? getQuickLinkImage(this.assetPath) : void 0;
}
}
export default CustomActivityLinkRecord;