decord/source/modules/application_commands/native/ApplicationCommandUtils.tsx
github-actions a36fe4ec9c chore: update source for alpha 347.0
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-14 20:04:03 +00:00

83 lines
3.4 KiB
TypeScript

// Module ID: 12361
// Function ID: 12362
// Name: application_commands/ApplicationCommandUtils
// Dependencies: [4977, 4976, 5080, 1396, 12362, 12363, 7626, 1884, 10762, 9436, 2]
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
// Module 12361 (application_commands/ApplicationCommandUtils)
import AvatarUtilsDefault from "AvatarUtils" /* 1396 */;
import _modDef1884 from "module_1884" /* 1884 */;
import DraftStore from "DraftStore" /* 4977 */;
import ApplicationCommandConstants from "ApplicationCommandConstants" /* 5080 */;
import ApplicationCommandTypes from "ApplicationCommandTypes" /* 7626 */;
import UploadAttachmentActionCreatorsDefault from "UploadAttachmentActionCreators" /* 9436 */;
import showUploadPreviewActionSheetDefault from "showUploadPreviewActionSheet" /* 10762 */;
import _modDef12362 from "module_12362" /* 12362 */;
import _modDef12363 from "module_12363" /* 12363 */;
import UploadAttachmentStore from "UploadAttachmentStore" /* 4976 */;
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(_modDef12362);
} else if (tmp10.FRECENCY === id) {
return AvatarUtilsDefault.makeSource(_modDef12363);
} 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);
}
};