222 lines
9.3 KiB
TypeScript
222 lines
9.3 KiB
TypeScript
/* Metro module 11542; source: modules/messages/LegacyCommands.tsx; dependencies: [57, 6540, 4814, 661, 3829, 7874, 3855, 7151, 3795, 7067, 4863, 2] */
|
|
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
|
|
var object2;
|
|
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_3 = importDefault(57) /* metro dependency 57 */;
|
|
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
|
|
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_6 = constantsModule.AnalyticEvents;
|
|
const env0_7 = constantsModule.MARKDOWN_SPOILER_WRAPPER;
|
|
const env0_8 = constantsModule.ME;
|
|
const env0_9 = RegExp('\\\\([*?+/])', 'g');
|
|
object2 = {};
|
|
object2.tts = {action: function() {
|
|
var object = {};
|
|
var EnableTTSCommand = require(dependencyMap[4]).EnableTTSCommand;
|
|
object.tts = EnableTTSCommand.getSetting();
|
|
return object;
|
|
}};
|
|
object2.me = {action: function(a0) {
|
|
return {content: '_' + a0 + '_'};
|
|
}};
|
|
object2.tableflip = {action: function(a0) {
|
|
var object = {};
|
|
object.content = ('' + a0 + ' (╯°□°)╯︵ ┻━┻').trim();
|
|
return object;
|
|
}};
|
|
object2.unflip = {action: function(a0) {
|
|
var object = {};
|
|
object.content = ('' + a0 + ' ┬─┬ノ( º _ ºノ)').trim();
|
|
return object;
|
|
}};
|
|
object2.shrug = {action: function(a0) {
|
|
var object = {};
|
|
object.content = ('' + a0 + ' ¯\\_(ツ)_/¯').trim();
|
|
return object;
|
|
}};
|
|
object2.nick = {action: action_88451};
|
|
const object3 = {};
|
|
object3.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(RegExp('^\\+:(.+?): *$', ''));
|
|
object3.action = action_88452;
|
|
object2.reaction = object3;
|
|
const object4 = {};
|
|
object4.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(RegExp('^s\\/([^\\/\\\\]*(?:\\\\.[^\\/\\\\]*)*)\\/([^\\/\\\\]*(?:\\\\.[^\\/\\\\]*)*)(?:\\/([g]*))?$',
|
|
''));
|
|
object4.action = action_88453;
|
|
object2.searchReplace = object4;
|
|
object2.spoiler = {action: action_88456};
|
|
Object = global.Object;
|
|
Object.setPrototypeOf(object2, null);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/LegacyCommands.tsx');
|
|
exports.COMMANDS = object2;
|
|
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 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, MessageStore, [id])) {
|
|
getMessages = MessageStore.getMessages;
|
|
id = channel.id;
|
|
value3 = Reflect.apply(getMessages, MessageStore, [id]).last();
|
|
if (value3 == null) {
|
|
return undefined;
|
|
}
|
|
id = value3.id;
|
|
if (id == null) {
|
|
return undefined;
|
|
}
|
|
value4 = EmojiStore.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 = env0_3(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 object2 = {};
|
|
object2.content = MARKDOWN_SPOILER_WRAPPER(a0).trim();
|
|
return object2;
|
|
}
|
|
|
|
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);
|
|
}
|
|
|