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

74 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 11658
// Function ID: 11659
2026-07-20 16:05:17 +00:00
// Name: getApplicationCommandsIconSource
2026-08-13 07:00:46 +00:00
// Dependencies: [4681, 4680, 4778, 1435, 11659, 11660, 7030, 1902, 10051, 8405, 2]
2026-07-20 16:05:17 +00:00
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
2026-08-13 07:00:46 +00:00
// Module 11658 (getApplicationCommandsIconSource)
2026-07-29 08:29:29 +00:00
import { DraftType } from "handleChanged";
import map from "map";
2026-07-23 10:11:24 +00:00
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-08-13 07:00:46 +00:00
return importDefault(1435).makeSource(importDefault(11659));
2026-08-10 06:55:34 +00:00
} else if (tmp10.FRECENCY === id) {
2026-08-13 07:00:46 +00:00
return importDefault(1435).makeSource(importDefault(11660));
2026-07-20 16:05:17 +00:00
} else {
2026-08-13 07:00:46 +00:00
if (section.type === require(7030) /* ApplicationCommandSectionType */.ApplicationCommandSectionType.APPLICATION) {
2026-08-11 06:20:06 +00:00
let obj = importDefault(1435);
2026-07-29 08:29:29 +00:00
obj = { id: null, icon: null, bot: null, botIconFirst: true, guildMember: null };
({ id: obj2[0], icon: obj2[1], application } = section);
2026-07-20 16:05:17 +00:00
let bot;
2026-07-29 08:29:29 +00:00
if (application != null) {
2026-07-20 16:05:17 +00:00
bot = application.bot;
}
2026-07-29 08:29:29 +00:00
obj[2] = bot;
obj[4] = stateFromStores;
2026-07-20 16:05:17 +00:00
let applicationIconSource = obj.getApplicationIconSource(obj);
} else {
2026-08-11 06:20:06 +00:00
applicationIconSource = importDefault(1902);
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-29 08:29:29 +00:00
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);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
}
if (null != found) {
if (obj2 != null) {
const result = obj2.insertOrJumpCommandOption(found, undefined, false, { displayText: "" });
}
}
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[4] = upload;
2026-08-13 07:00:46 +00:00
importDefault(10051)(obj);
2026-07-20 16:05:17 +00:00
}
};