Files
discord-decomp/sources/modules/application_commands/native/ApplicationCommandUtils.tsx
T
2026-07-28 01:06:53 +03:00

88 lines
5.4 KiB
TypeScript

/* Metro module 11752; source: modules/application_commands/native/ApplicationCommandUtils.tsx; dependencies: [4645, 4644, 5066, 1423, 11753, 11754, 5068, 1860, 11093, 7879, 2] */
import UploadAttachmentStore from '../../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */
import UploadAttachmentActionCreators from '../../../actions/UploadAttachmentActionCreators.tsx'; /* Metro dependency 7879 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as ApplicationCommandConstantsModule from '../ApplicationCommandConstants.tsx'; /* Metro dependency 5066 */
import * as ApplicationCommandTypesModule from '../ApplicationCommandTypes.tsx'; /* Metro dependency 5068 */
function _fun90058(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11938:6, offset: 0x02028f7a, size: 175 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/application_commands/native/ApplicationCommandUtils.tsx');
exports.getApplicationCommandsIconSource = getApplicationCommandsIconSource;
exports.openCommandAttachmentPreview = openCommandAttachmentPreview;
function getApplicationCommandsIconSource(a0, a1) { // fn#90059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11938:286, offset: 0x02029029, size: 308 bytes, params: 3, frame: 17
var r2;
var getApplicationIconSource;
var application;
if (a0 == null) {
return null;
}
const id = a0.id;
var value;
const BUILT_IN = BuiltInSectionId.BUILT_IN;
if (BUILT_IN === id) {
return (importDefault(1423) /* metro dependency 1423: AvatarUtils */).makeSource(importDefault(11753) /* metro dependency 11753 */);
}
const FRECENCY = BuiltInSectionId.FRECENCY;
if (FRECENCY === id) {
return (importDefault(1423) /* metro dependency 1423: AvatarUtils */).makeSource(importDefault(11754) /* metro dependency 11754 */);
}
const type = a0.type;
const value2 = undefined;
const ApplicationCommandSectionType = (ApplicationCommandTypesModule).ApplicationCommandSectionType;
const APPLICATION = ApplicationCommandSectionType.APPLICATION;
if (type === APPLICATION) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
getApplicationIconSource = value.getApplicationIconSource;
application = a0.application;
value = Reflect.apply(getApplicationIconSource, value, [{id: a0.id, icon: a0.icon,
bot: application == null ? value2 : application.bot, botIconFirst: true, guildMember: a1}]);
r2 = value;
} else {
r2 = importDefault(1860) /* metro dependency 1860 */;
}
return r2;
}
function openCommandAttachmentPreview(a0, a1, a2, a3) { // fn#90060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11938:671, offset: 0x0202915d, size: 132 bytes, params: 5, frame: 17
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const uploadAttachmentStoreBinding = UploadAttachmentStore;
const getUpload = uploadAttachmentStoreBinding.getUpload;
const SlashCommand = DraftType.SlashCommand;
const value2 = Reflect.apply(getUpload, uploadAttachmentStoreBinding, [a1, a2, SlashCommand]);
if (value2 != null) {
(importDefault(11093) /* metro dependency 11093: showUploadPreviewActionSheet */)({channelId: a1,
disableSpoiler: true, onClose: a3, onRemove: onRemove_90061, upload: value2});
}
function openCommandAttachmentPreviewOnRemove() { // fn#90061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11938:823, owner: openCommandAttachmentPreview.onRemove, offset: 0x020291e1, size: 189 bytes, params: 1, frame: 18
var environment;
const value = environment.__proto__;
const value2 = undefined;
const defaultImport = UploadAttachmentActionCreators;
const remove = defaultImport.remove;
const id = DraftStoreModule.DraftType.id;
const SlashCommand = DraftType.SlashCommand;
Reflect.apply(remove, defaultImport, [require, id, SlashCommand]);
const r5 = env0_0 == null || env0_0.props.activeCommand == null || env0_0.props.activeCommand.options == null ? value2 : env0_0.props.activeCommand.options.find(function({name}) {
return name === importDefault;
});
if (r5 != null) {
if (env0_0 != null) {
env0_0.insertOrJumpCommandOption(r5, value2, false, {displayText: ''});
}
}
return value2;
}
}
}
global.__d(_fun90058, 11752, [4645, 4644, 5066, 1423, 11753, 11754, 5068, 1860, 11093, 7879,
2]) /* metro module 11752, dependencies: [4645, 4644, 5066, 1423, 11753, 11754, 5068, 1860, 11093, 7879, 2] */;