52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
// Metro module 9884 (f9885).
|
|
import { MessageSendLocation } from "./MessageConstants";
|
|
import MessageActionCreators from "../../actions/MessageActionCreators";
|
|
import { retryCommandMessage } from "../application_commands/executeCommand";
|
|
import { CloudUpload } from "../../lib/uploader/CloudUpload";
|
|
import { handleUploadMessageAttachmentsErrors } from "../media_uploads/handleUploadAttachmentErrors.native";
|
|
export default function retrySendMessage(a0, a1, a2) {
|
|
let c17538_0 = a0;
|
|
let r6 = arguments[3];
|
|
if (r6 === void 0) {
|
|
r6 = {};
|
|
}
|
|
MessageActionCreators.deleteMessage(a0.id, a1.id, true);
|
|
if (a1.isCommandType()) {
|
|
if (a1.interactionData != null && r6.applicationId != null) {
|
|
retryCommandMessage(a1, a0, r6);
|
|
}
|
|
} else {
|
|
const { content, tts } = a1;
|
|
let messageReference = a1.messageReference;
|
|
const { flags, nonce } = a1;
|
|
const attachmentsToUpload = a2 == null ? void 0 : a2.map((item) => item.on == null ? CloudUpload.fromJson(item) : item);
|
|
const id = a0.id;
|
|
const r37 = {
|
|
content,
|
|
tts,
|
|
invalidEmojis: [],
|
|
validNonShortcutEmojis: []
|
|
};
|
|
if (messageReference == null) {
|
|
messageReference = void 0;
|
|
}
|
|
MessageActionCreators.sendMessage(id, r37, void 0, {
|
|
...r6,
|
|
nonce,
|
|
flags,
|
|
messageReference,
|
|
location: MessageSendLocation.RETRY,
|
|
attachmentsToUpload,
|
|
onAttachmentUploadError: (a0, a1, a2) => {
|
|
handleUploadMessageAttachmentsErrors({
|
|
file: a0,
|
|
guildId: c17538_0.getGuildId(),
|
|
analyticsLocations: [],
|
|
code: a1,
|
|
reason: a2
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|