decord/source/modules/application_commands/native/ApplicationCommandUtils.tsx
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

83 lines
3.4 KiB
TypeScript

// Module ID: 12326
// Function ID: 12327
// Name: application_commands/ApplicationCommandUtils
// Dependencies: [4948, 4947, 5051, 1396, 12327, 12328, 7597, 1884, 10724, 9399, 2]
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
// Module 12326 (application_commands/ApplicationCommandUtils)
import AvatarUtilsDefault from "AvatarUtils" /* 1396 */;
import _modDef1884 from "module_1884" /* 1884 */;
import DraftStore from "DraftStore" /* 4948 */;
import ApplicationCommandConstants from "ApplicationCommandConstants" /* 5051 */;
import ApplicationCommandTypes from "ApplicationCommandTypes" /* 7597 */;
import UploadAttachmentActionCreatorsDefault from "UploadAttachmentActionCreators" /* 9399 */;
import showUploadPreviewActionSheetDefault from "showUploadPreviewActionSheet" /* 10724 */;
import _modDef12327 from "module_12327" /* 12327 */;
import _modDef12328 from "module_12328" /* 12328 */;
import UploadAttachmentStore from "UploadAttachmentStore" /* 4947 */;
import size from "module_2" /* 2 */;
const DraftType = DraftStore.DraftType;
const BuiltInSectionId = ApplicationCommandConstants.BuiltInSectionId;
let result = size.fileFinishedImporting("modules/application_commands/native/ApplicationCommandUtils.tsx");
export const getApplicationCommandsIconSource = function getApplicationCommandsIconSource(section, stateFromStores) {
if (null == section) {
return null;
} else {
const id = section.id;
if (BuiltInSectionId.BUILT_IN === id) {
return AvatarUtilsDefault.makeSource(_modDef12327);
} else if (tmp10.FRECENCY === id) {
return AvatarUtilsDefault.makeSource(_modDef12328);
} else {
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);
let bot;
if (application != null) {
bot = application.bot;
}
obj5.bot = bot;
obj5.guildMember = stateFromStores;
let applicationIconSource = AvatarUtilsDefault.getApplicationIconSource(obj5);
} else {
applicationIconSource = _modDef1884;
}
return applicationIconSource;
}
}
};
export const openCommandAttachmentPreview = function openCommandAttachmentPreview(applicationCommandManager, channelId, name, fn) {
closure_0 = applicationCommandManager;
importDefault = channelId;
dependencyMap = name;
upload = UploadAttachmentStore.getUpload(channelId, name, upload.SlashCommand);
if (null != upload) {
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);
}
}
}
if (null != found) {
if (obj2 != null) {
const result = obj2.insertOrJumpCommandOption(found, undefined, false, { displayText: "" });
}
}
},
upload
};
showUploadPreviewActionSheetDefault(obj);
}
};