decord/source/modules/application_commands/native/ApplicationCommandUtils.tsx
2026-08-15 05:55:55 +00:00

73 lines
2.7 KiB
TypeScript

// Module ID: 11392
// Function ID: 11393
// Name: getApplicationCommandsIconSource
// Dependencies: [4825, 4824, 5246, 1435, 11393, 11394, 5248, 1902, 10267, 8466, 2]
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
// Module 11392 (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(11393));
} else if (tmp10.FRECENCY === id) {
return importDefault(1435).makeSource(importDefault(11394));
} else {
if (section.type === require(5248) /* 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(10267)(obj);
}
};