2026-09-15 14:23:42 +00:00
|
|
|
// Module ID: 12365
|
|
|
|
|
// Function ID: 12366
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: application_commands/ApplicationCommandUtils
|
2026-09-15 14:23:42 +00:00
|
|
|
// Dependencies: [4980, 4979, 5083, 1397, 12366, 12367, 7630, 1885, 10766, 9439, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
|
|
|
|
|
|
2026-09-15 14:23:42 +00:00
|
|
|
// Module 12365 (application_commands/ApplicationCommandUtils)
|
|
|
|
|
import AvatarUtilsDefault from "AvatarUtils" /* 1397 */;
|
|
|
|
|
import _modDef1885 from "module_1885" /* 1885 */;
|
|
|
|
|
import DraftStore from "DraftStore" /* 4980 */;
|
|
|
|
|
import ApplicationCommandConstants from "ApplicationCommandConstants" /* 5083 */;
|
|
|
|
|
import ApplicationCommandTypes from "ApplicationCommandTypes" /* 7630 */;
|
|
|
|
|
import UploadAttachmentActionCreatorsDefault from "UploadAttachmentActionCreators" /* 9439 */;
|
|
|
|
|
import showUploadPreviewActionSheetDefault from "showUploadPreviewActionSheet" /* 10766 */;
|
|
|
|
|
import _modDef12366 from "module_12366" /* 12366 */;
|
|
|
|
|
import _modDef12367 from "module_12367" /* 12367 */;
|
|
|
|
|
import UploadAttachmentStore from "UploadAttachmentStore" /* 4979 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const DraftType = DraftStore.DraftType;
|
|
|
|
|
const BuiltInSectionId = ApplicationCommandConstants.BuiltInSectionId;
|
|
|
|
|
let result = size.fileFinishedImporting("modules/application_commands/native/ApplicationCommandUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const getApplicationCommandsIconSource = function getApplicationCommandsIconSource(section, stateFromStores) {
|
|
|
|
|
if (null == section) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
const id = section.id;
|
|
|
|
|
if (BuiltInSectionId.BUILT_IN === id) {
|
2026-09-15 14:23:42 +00:00
|
|
|
return AvatarUtilsDefault.makeSource(_modDef12366);
|
2026-09-14 20:04:03 +00:00
|
|
|
} else if (tmp10.FRECENCY === id) {
|
2026-09-15 14:23:42 +00:00
|
|
|
return AvatarUtilsDefault.makeSource(_modDef12367);
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
if (section.type === ApplicationCommandTypes.ApplicationCommandSectionType.APPLICATION) {
|
|
|
|
|
const obj5 = { id: null, icon: null, bot: null, botIconFirst: true, guildMember: null };
|
|
|
|
|
({ id: obj2.id, icon: obj2.icon, application } = section);
|
2026-07-20 16:05:17 +00:00
|
|
|
let bot;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (application != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
bot = application.bot;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj5.bot = bot;
|
|
|
|
|
obj5.guildMember = stateFromStores;
|
|
|
|
|
let applicationIconSource = AvatarUtilsDefault.getApplicationIconSource(obj5);
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-09-15 14:23:42 +00:00
|
|
|
applicationIconSource = _modDef1885;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return applicationIconSource;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export const openCommandAttachmentPreview = function openCommandAttachmentPreview(applicationCommandManager, channelId, name, fn) {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = applicationCommandManager;
|
|
|
|
|
importDefault = channelId;
|
|
|
|
|
dependencyMap = name;
|
2026-09-10 05:38:07 +00:00
|
|
|
upload = UploadAttachmentStore.getUpload(channelId, name, upload.SlashCommand);
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != upload) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj = {
|
|
|
|
|
channelId,
|
|
|
|
|
disableSpoiler: true,
|
|
|
|
|
onClose: fn,
|
|
|
|
|
onRemove() {
|
|
|
|
|
UploadAttachmentActionCreatorsDefault.remove(closure_1, upload.id, DraftType.SlashCommand);
|
|
|
|
|
let found;
|
|
|
|
|
if (closure_0 != null) {
|
|
|
|
|
const activeCommand = obj2.props.activeCommand;
|
|
|
|
|
if (activeCommand != null) {
|
|
|
|
|
const options = activeCommand.options;
|
|
|
|
|
if (options != null) {
|
|
|
|
|
found = options.find((name) => name.name === name);
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
if (null != found) {
|
|
|
|
|
if (obj2 != null) {
|
|
|
|
|
const result = obj2.insertOrJumpCommandOption(found, undefined, false, { displayText: "" });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
upload
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
2026-08-24 06:08:38 +00:00
|
|
|
showUploadPreviewActionSheetDefault(obj);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|