Files
2026-07-28 01:06:53 +03:00

225 lines
10 KiB
TypeScript

/* Metro module 11542; source: modules/messages/LegacyCommands.tsx; dependencies: [57, 6540, 4814, 661, 3829, 7874, 3855, 7151, 3795, 7067, 4863, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import MessageStore from '../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
import EmojiStore from '../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun88444(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11728:6, offset: 0x01fe332a, size: 502 bytes, params: 8, frame: 23
const env0_0 = require;
const executeCommand_88445 = function(a0, a1, a2, a3) {
var defaultImport = importDefault(dependencyMap[10]);
var SLASH_COMMAND_USED = AnalyticEvents.SLASH_COMMAND_USED;
defaultImport.trackWithMetadata(SLASH_COMMAND_USED, {command: a0});
return a1.action(a2, a3);
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_9 = RegExp('\\\\([*?+/])', 'g');
object = {};
object.tts = {action: function() {
var object = {};
var EnableTTSCommand = require(dependencyMap[4]).EnableTTSCommand;
object.tts = EnableTTSCommand.getSetting();
return object;
}};
object.me = {action: function(a0) {
return {content: '_' + a0 + '_'};
}};
object.tableflip = {action: function(a0) {
var object = {};
object.content = ('' + a0 + ' (╯°□°)╯︵ ┻━┻').trim();
return object;
}};
object.unflip = {action: function(a0) {
var object = {};
object.content = ('' + a0 + ' ┬─┬ノ( º _ ºノ)').trim();
return object;
}};
object.shrug = {action: function(a0) {
var object = {};
object.content = ('' + a0 + ' ¯\\_(ツ)_/¯').trim();
return object;
}};
object.nick = {action: action_88451};
const object5 = {};
object5.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(RegExp('^\\+:(.+?): *$', ''));
object5.action = action_88452;
object.reaction = object5;
const object6 = {};
object6.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(RegExp('^s\\/([^\\/\\\\]*(?:\\\\.[^\\/\\\\]*)*)\\/([^\\/\\\\]*(?:\\\\.[^\\/\\\\]*)*)(?:\\/([g]*))?$',
''));
object6.action = action_88453;
object.searchReplace = object6;
object.spoiler = {action: action_88456};
Object = global.Object;
Object.setPrototypeOf(object, null);
(FileImportTrackerModule).fileFinishedImporting('modules/messages/LegacyCommands.tsx');
exports.COMMANDS = object;
exports.handleLegacyCommands = handleLegacyCommands;
function action_88451(a0, {channel}) { // fn#88451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11728:522, offset: 0x01fe3659, size: 90 bytes, params: 3, frame: 17
var defaultImport;
if (channel.guild_id != null) {
defaultImport = importDefault(7874) /* metro dependency 7874: ChangeNicknameActionCreators */;
defaultImport.changeNickname(channel.guild_id, channel.id, ME, a0);
return {content: ''};
}
}
function action_88452(a0, {isEdit, channel}) { // fn#88452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11728:685, offset: 0x01fe36b3, size: 252 bytes, params: 3, frame: 20
var getMessages;
var value3;
var emojiStoreBinding;
var value4;
var getByName;
var value5;
var value6;
var addReaction;
var id2;
var moduleValue;
if (!isEdit) {
var value;
var hasPresent = MessageStore.hasPresent;
var id = channel.id;
if (Reflect.apply(hasPresent, messageStoreBinding, [id])) {
messageStoreBinding = MessageStore;
getMessages = messageStoreBinding.getMessages;
id = channel.id;
value3 = Reflect.apply(getMessages, messageStoreBinding, [id]).last();
if (value3 == null) {
return undefined;
}
id = value3.id;
if (id == null) {
return undefined;
}
emojiStoreBinding = EmojiStore;
value4 = emojiStoreBinding.getDisambiguatedEmojiContext(channel.guild_id);
getByName = value4.getByName;
value5 = a0.trim();
value6 = Reflect.apply(getByName, value4, [value5.slice(2, -1)]);
if (value6 == null) {
return undefined;
}
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
addReaction = value.addReaction;
id = channel.id;
id2 = value3.id;
moduleValue = require(3795) /* metro dependency 3795: ReactionUtils */;
Reflect.apply(addReaction, value, [id, id2, moduleValue.toReactionEmoji(value6)]);
return {content: ''};
}
}
}
function action_88453(a0, {isEdit, channel}) { // fn#88453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11728:1093, offset: 0x01fe37af, size: 450 bytes, params: 3, frame: 23
var r8;
var r5;
if (isEdit) {
return undefined;
}
var value;
const lastEditableMessage = MessageStore.getLastEditableMessage(channel.id);
if (lastEditableMessage != null) {
if (lastEditableMessage.id == null) {
return {content: ''};
}
var Array = global.Array;
var value6 = Module00057(Array.from(a0.match(this.match.regex) ?? []), 4);
value6[0];
var property = value6[1];
var property2 = value6[2];
r8 = value6[3]?.split('');
r8 = r8 ?? [];
var replace = property.replace;
var binding = env0_9;
var value8 = Reflect.apply(replace, property, [binding, function(a0, a1) {
return a1;
}]);
var value9 = property2.replace(binding, function(a0, a1) {
return a1;
});
var value10 = r8.includes('g');
var content = lastEditableMessage.content;
r5 = value10 ? content.replaceAll(value8, value9) : content.replace(value8, value9);
if (r5 == null) {
if (lastEditableMessage.attachments.length !== 0) {
if (r5 !== lastEditableMessage.content) {
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value.editMessage(channel.id, lastEditableMessage.id, {content: r5});
}
} else {
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value.deleteMessage(channel.id, lastEditableMessage.id);
}
} else if (r5.trim() !== '') {
if (r5 !== lastEditableMessage.content) {
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value.editMessage(channel.id, lastEditableMessage.id, {content: r5});
}
} else if (lastEditableMessage.attachments.length !== 0) {
if (r5 !== lastEditableMessage.content) {
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value.editMessage(channel.id, lastEditableMessage.id, {content: r5});
}
} else {
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value.deleteMessage(channel.id, lastEditableMessage.id);
}
}
return {content: ''};
}
function action_88456(a0) { // fn#88456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11728:1660, offset: 0x01fe3971, size: 35 bytes, params: 2, frame: 12
const object = {};
object.content = MARKDOWN_SPOILER_WRAPPER(a0).trim();
return object;
}
function handleLegacyCommands(a0, a1) { // fn#88457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11728:1940, offset: 0x01fe3994, size: 115 bytes, params: 3, frame: 25
var propertyName;
var propertyName2;
var property;
var match;
var regex;
var test;
const properties = Object.keys(env0_10);
const properties2 = 0;
const properties3 = properties.length;
if (properties === undefined) {
return undefined;
}
let r10 = properties2;
loopExit1: while (true) {
propertyName = properties[r10];
propertyName2 = r10 + 1;
if (propertyName === undefined) {
return undefined;
}
property = env0_10[propertyName];
match = property.match;
if (match == null) {
r10 = propertyName2;
continue;
}
match = property.match;
regex = match.regex;
if (regex == null) {
r10 = propertyName2;
continue;
}
test = regex.test;
if (Reflect.apply(test, regex, [a0])) {
break loopExit1;
}
r10 = propertyName2;
continue;
}
return executeCommand_88445(propertyName, property, a0, a1);
}
}
global.__d(_fun88444, 11542, [57, 6540, 4814, 661, 3829, 7874, 3855, 7151, 3795, 7067, 4863,
2]) /* metro module 11542, dependencies: [57, 6540, 4814, 661, 3829, 7874, 3855, 7151, 3795, 7067, 4863, 2] */;