decord/source/modules/messages/native/renderer/createMessageFailedEmbed.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

60 lines
3 KiB
TypeScript

// Module ID: 8302
// Function ID: 8303
// Name: createMessageFailedEmbed
// Dependencies: [8069, 1074, 8082, 8303, 1115, 8304, 5221, 2]
// Exports: createAutomodBlockedMessageEmbed, default
// Module 8302 (createMessageFailedEmbed)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1115 */;
import RowGeneratorConstants from "RowGeneratorConstants" /* 8069 */;
import renderer_EmbedUtils from "renderer/EmbedUtils" /* 8082 */;
import _modDef8303 from "module_8303" /* 8303 */;
import _modDef8304 from "module_8304" /* 8304 */;
import size from "module_2" /* 2 */;
const MessageFailureState = RowGeneratorConstants.MessageFailureState;
const MessageEmbedTypes = Constants.MessageEmbedTypes;
const result = size.fileFinishedImporting("modules/messages/native/renderer/createMessageFailedEmbed.tsx");
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(_modDef8304);
let obj3 = obj2;
} 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;
let str = "";
if (0 !== uploaderFile.currentSize) {
const _HermesInternal = HermesInternal;
str = " (" + tmp6(5221).sizeString(uploaderFile.currentSize) + ")";
const tmp6Result = tmp6(5221);
}
obj3.attachmentsSize = "" + str;
obj3.bodyTextColor = colors.embedBodyTextColor;
tmp6 = require;
}
} 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;
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(_modDef8303) };
return obj;
};