decord/source/modules/messages/native/renderer/createMessageFailedEmbed.tsx
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

60 lines
3 KiB
TypeScript

// Module ID: 8180
// Function ID: 8181
// Name: createMessageFailedEmbed
// Dependencies: [7947, 1074, 7960, 8181, 1114, 8182, 5148, 2]
// Exports: createAutomodBlockedMessageEmbed, default
// Module 8180 (createMessageFailedEmbed)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1114 */;
import RowGeneratorConstants from "RowGeneratorConstants" /* 7947 */;
import renderer_EmbedUtils from "renderer/EmbedUtils" /* 7960 */;
import _modDef8181 from "module_8181" /* 8181 */;
import _modDef8182 from "module_8182" /* 8182 */;
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(_modDef8182);
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(5148).sizeString(uploaderFile.currentSize) + ")";
const tmp6Result = tmp6(5148);
}
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(_modDef8181) };
return obj;
};