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

74 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-10 06:55:34 +00:00
// Module ID: 11602
// Function ID: 11603
2026-07-20 16:05:17 +00:00
// Name: getApplicationCommandsIconSource
2026-08-10 06:55:34 +00:00
// Dependencies: [4640, 4639, 4737, 1416, 11603, 11604, 6982, 1883, 10007, 8357, 2]
2026-07-20 16:05:17 +00:00
// Exports: getApplicationCommandsIconSource, openCommandAttachmentPreview
2026-08-10 06:55:34 +00:00
// Module 11602 (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-08 06:10:11 +00:00
return importDefault(1416).makeSource(importDefault(11603));
2026-08-10 06:55:34 +00:00
} else if (tmp10.FRECENCY === id) {
return importDefault(1416).makeSource(importDefault(11604));
2026-07-20 16:05:17 +00:00
} else {
2026-08-08 06:10:11 +00:00
if (section.type === require(6982) /* ApplicationCommandSectionType */.ApplicationCommandSectionType.APPLICATION) {
2026-07-29 08:29:29 +00:00
let obj = importDefault(1416);
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-06 08:05:19 +00:00
applicationIconSource = importDefault(1883);
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-10 06:55:34 +00:00
importDefault(10007)(obj);
2026-07-20 16:05:17 +00:00
}
};