38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
// Metro module 12351 (f12352).
|
|
import { createAppMessageEmbed } from "./createAppMessageEmbed";
|
|
import { getOrFetchCustomActivityLink } from "../../../activities/utils/CustomActivityLinkUtils";
|
|
export function createActivityMessageEmbed({ theme, embedUrl, message, app, params }) {
|
|
const appMessageEmbed = createAppMessageEmbed({
|
|
theme,
|
|
embedUrl,
|
|
message,
|
|
app
|
|
});
|
|
if (appMessageEmbed == null) {
|
|
return null;
|
|
}
|
|
const linkId = params.linkId;
|
|
if (linkId == null) {
|
|
return appMessageEmbed;
|
|
}
|
|
const orFetchCustomActivityLink = getOrFetchCustomActivityLink(app.id, linkId);
|
|
const r24 = orFetchCustomActivityLink == null;
|
|
let r25 = null;
|
|
if (!r24) {
|
|
let staticBannerSrc = orFetchCustomActivityLink.getAssetURL();
|
|
if (staticBannerSrc == null) {
|
|
staticBannerSrc = null;
|
|
}
|
|
r25 = {
|
|
...appMessageEmbed,
|
|
title: app.name,
|
|
header: orFetchCustomActivityLink.title,
|
|
info: orFetchCustomActivityLink.description,
|
|
bannerRatio: "bot",
|
|
staticBannerSrc,
|
|
tagline: null
|
|
};
|
|
}
|
|
return r25;
|
|
}
|