decord/source/modules/application_commands/native/ApplicationCommandUtils.tsx
2026-08-14 17:33:39 +00:00

73 lines
2.7 KiB
TypeScript

// Module ID: 11675
// Function ID: 11676
// Name: getApplicationCommandsIconSource
// Dependencies: [4703, 4702, 4800, 1435, 11676, 11677, 7052, 1902, 10062, 8427, 2]
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
// Module 11675 (getApplicationCommandsIconSource)
import { DraftType } from "handleChanged";
import map from "map";
import { BuiltInSectionId } from "TRUE_OPTION_NAME";
let result = require("TRUE_OPTION_NAME").fileFinishedImporting("modules/application_commands/native/ApplicationCommandUtils.tsx");
export const getApplicationCommandsIconSource = function getApplicationCommandsIconSource(section, stateFromStores) {
let application;
if (null == section) {
return null;
} else {
const id = section.id;
if (BuiltInSectionId.BUILT_IN === id) {
return importDefault(1435).makeSource(importDefault(11676));
} else if (tmp10.FRECENCY === id) {
return importDefault(1435).makeSource(importDefault(11677));
} else {
if (section.type === require(7052) /* ApplicationCommandSectionType */.ApplicationCommandSectionType.APPLICATION) {
let obj = importDefault(1435);
obj = { id: null, icon: null, bot: null, botIconFirst: true, guildMember: null };
({ id: obj2[0], icon: obj2[1], application } = section);
let bot;
if (application != null) {
bot = application.bot;
}
obj[2] = bot;
obj[4] = stateFromStores;
let applicationIconSource = obj.getApplicationIconSource(obj);
} else {
applicationIconSource = importDefault(1902);
}
return applicationIconSource;
}
}
};
export const openCommandAttachmentPreview = function openCommandAttachmentPreview(applicationCommandManager, channelId, name, fn) {
let closure_0 = applicationCommandManager;
const importDefault = channelId;
const dependencyMap = name;
upload = upload.getUpload(channelId, name, upload.SlashCommand);
if (null != upload) {
const obj = { channelId: null, disableSpoiler: true, onClose: null, onRemove: null, upload: null };
obj[0] = channelId;
obj[2] = fn;
obj[3] = function onRemove() {
channelId(name[9]).remove(channelId, upload.id, upload.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 === closure_2);
}
}
}
if (null != found) {
if (obj2 != null) {
const result = obj2.insertOrJumpCommandOption(found, undefined, false, { displayText: "" });
}
}
};
obj[4] = upload;
importDefault(10062)(obj);
}
};