decord/source/modules/messages/native/renderer/createMessageFailedEmbed.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

60 lines
3 KiB
TypeScript

// Module ID: 8217
// Function ID: 8218
// Name: createMessageFailedEmbed
// Dependencies: [7985, 1074, 7998, 8218, 1114, 8219, 5184, 2]
// Exports: createAutomodBlockedMessageEmbed, default
// Module 8217 (createMessageFailedEmbed)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1114 */;
import RowGeneratorConstants from "RowGeneratorConstants" /* 7985 */;
import renderer_EmbedUtils from "renderer/EmbedUtils" /* 7998 */;
import _modDef8218 from "module_8218" /* 8218 */;
import _modDef8219 from "module_8219" /* 8219 */;
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(_modDef8219);
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(5184).sizeString(uploaderFile.currentSize) + ")";
const tmp6Result = tmp6(5184);
}
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(_modDef8218) };
return obj;
};