decord/source/modules/application_commands/native/ApplicationCommandUtils.tsx

79 lines
2.9 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 11367
// Function ID: 88198
2026-07-20 16:05:17 +00:00
// Name: getApplicationCommandsIconSource
2026-07-28 08:39:19 +00:00
// Dependencies: [4503, 4502, 4601, 1392, 11368, 11369, 5686, 1831, 9648, 6168, 2]
2026-07-20 16:05:17 +00:00
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
2026-07-28 08:39:19 +00:00
// Module 11367 (getApplicationCommandsIconSource)
2026-07-23 10:11:24 +00:00
import { DraftType } from "_isNativeReflectConstruct";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { BuiltInSectionId } from "TRUE_OPTION_NAME";
let result = require("TRUE_OPTION_NAME").fileFinishedImporting("modules/application_commands/native/ApplicationCommandUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getApplicationCommandsIconSource = function getApplicationCommandsIconSource(section, stateFromStores) {
let application;
if (null == section) {
return null;
} else {
const id = section.id;
if (BuiltInSectionId.BUILT_IN === id) {
2026-07-28 08:39:19 +00:00
return importDefault(1392).makeSource(importDefault(11368));
2026-07-27 11:26:19 +00:00
} else if (BuiltInSectionId.FRECENCY === id) {
2026-07-28 08:39:19 +00:00
return importDefault(1392).makeSource(importDefault(11369));
2026-07-20 16:05:17 +00:00
} else {
2026-07-28 08:39:19 +00:00
if (section.type === require(5686) /* ApplicationCommandSectionType */.ApplicationCommandSectionType.APPLICATION) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(1392);
2026-07-20 16:05:17 +00:00
obj = {};
({ id: obj2.id, icon: obj2.icon, application } = section);
let bot;
if (null != application) {
bot = application.bot;
}
obj.bot = bot;
obj.botIconFirst = true;
obj.guildMember = stateFromStores;
let applicationIconSource = obj.getApplicationIconSource(obj);
} else {
2026-07-23 10:11:24 +00:00
applicationIconSource = importDefault(1831);
2026-07-20 16:05:17 +00:00
}
return applicationIconSource;
}
}
};
export const openCommandAttachmentPreview = function openCommandAttachmentPreview(applicationCommandManager, channelId, name, fn) {
2026-07-23 10:11:24 +00:00
let closure_0 = applicationCommandManager;
2026-07-20 16:05:17 +00:00
const importDefault = channelId;
const dependencyMap = name;
2026-07-23 10:11:24 +00:00
upload = upload.getUpload(channelId, name, upload.SlashCommand);
2026-07-20 16:05:17 +00:00
if (null != upload) {
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
channelId,
disableSpoiler: true,
onClose: fn,
2026-07-23 10:11:24 +00:00
onRemove() {
let obj = channelId(name[9]);
obj.remove(channelId, upload.id, upload.SlashCommand);
2026-07-20 16:05:17 +00:00
let found;
2026-07-23 10:11:24 +00:00
if (null != applicationCommandManager) {
const activeCommand = applicationCommandManager.props.activeCommand;
2026-07-20 16:05:17 +00:00
if (null != activeCommand) {
const options = activeCommand.options;
if (null != options) {
2026-07-23 10:11:24 +00:00
found = options.find((name) => name.name === outer1_2);
2026-07-20 16:05:17 +00:00
}
}
}
if (null != found) {
2026-07-23 10:11:24 +00:00
if (null != applicationCommandManager) {
2026-07-20 16:05:17 +00:00
obj = { displayText: "" };
2026-07-23 10:11:24 +00:00
const result = applicationCommandManager.insertOrJumpCommandOption(found, undefined, false, obj);
2026-07-20 16:05:17 +00:00
}
}
},
upload
};
2026-07-28 08:39:19 +00:00
importDefault(9648)(obj);
2026-07-20 16:05:17 +00:00
}
};