decord/source/modules/messages/native/renderer/createMessageFailedEmbed.tsx

61 lines
3 KiB
TypeScript
Raw Normal View History

// Module ID: 8271
// Function ID: 8272
2026-07-20 16:05:17 +00:00
// Name: createMessageFailedEmbed
// Dependencies: [8037, 1074, 8050, 8272, 1114, 8273, 5215, 2]
2026-07-20 16:05:17 +00:00
// Exports: createAutomodBlockedMessageEmbed, default
// Module 8271 (createMessageFailedEmbed)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1114 */;
import RowGeneratorConstants from "RowGeneratorConstants" /* 8037 */;
import renderer_EmbedUtils from "renderer/EmbedUtils" /* 8050 */;
import _modDef8272 from "module_8272" /* 8272 */;
import _modDef8273 from "module_8273" /* 8273 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const MessageFailureState = RowGeneratorConstants.MessageFailureState;
const MessageEmbedTypes = Constants.MessageEmbedTypes;
const result = size.fileFinishedImporting("modules/messages/native/renderer/createMessageFailedEmbed.tsx");
2026-07-20 16:05:17 +00:00
export default function createMessageFailedEmbed(useAttachmentUploadPreview) {
({ uploaderFile, colors } = useAttachmentUploadPreview);
if (null != uploaderFile) {
if (useAttachmentUploadPreview.useAttachmentUploadPreview) {
const obj2 = { type: MessageEmbedTypes.TEXT, messageSendError: null, failureState: null, disableBackgroundColor: true, bodyTextColor: null, iconURL: null };
const intl3 = util.intl;
obj2.messageSendError = intl3.string(util.t.lBLP4u);
obj2.failureState = MessageFailureState.UNSPECIFIED;
obj2.bodyTextColor = colors.failedMessageBodyTextColor;
colors = renderer_EmbedUtils.getAssetUriForEmbed;
obj2.iconURL = colors(_modDef8273);
let obj3 = obj2;
2026-07-20 16:05:17 +00:00
} else {
obj3 = { type: MessageEmbedTypes.TEXT, numAttachments: null, failureState: null, attachmentsSize: null, bodyTextColor: null };
const intl2 = util.intl;
const obj4 = { count: uploaderFile.attachmentsCount };
obj3.numAttachments = intl2.formatToPlainString(util.t.D0noUt, obj4);
obj3.failureState = MessageFailureState.UPLOAD_FAILED;
2026-07-20 16:05:17 +00:00
let str = "";
if (0 !== uploaderFile.currentSize) {
const _HermesInternal = HermesInternal;
str = " (" + tmp6(5215).sizeString(uploaderFile.currentSize) + ")";
const tmp6Result = tmp6(5215);
2026-07-20 16:05:17 +00:00
}
obj3.attachmentsSize = "" + str;
obj3.bodyTextColor = colors.embedBodyTextColor;
2026-07-29 08:29:29 +00:00
tmp6 = require;
2026-07-20 16:05:17 +00:00
}
} else {
const obj = { type: MessageEmbedTypes.TEXT, messageSendError: null, failureState: null, disableBackgroundColor: true, bodyTextColor: null };
const intl = util.intl;
obj.messageSendError = intl.string(util.t.lBLP4u);
obj.failureState = MessageFailureState.UNSPECIFIED;
obj.bodyTextColor = colors.failedMessageBodyTextColor;
2026-07-20 16:05:17 +00:00
return obj;
}
};
export const createAutomodBlockedMessageEmbed = function createAutomodBlockedMessageEmbed(errorMessage) {
const obj = { type: MessageEmbedTypes.TEXT, messageSendError: errorMessage.errorMessage, failureState: MessageFailureState.AUTO_MODERATION_BLOCKED_MESSAGE, disableBackgroundColor: true, bodyTextColor: errorMessage.colors.automodBlockedBodyTextColor, iconURL: renderer_EmbedUtils.getAssetUriForEmbed(_modDef8272) };
2026-07-20 16:05:17 +00:00
return obj;
};