decord/source/modules/messages/LegacyCommands.tsx

182 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 11167
// Function ID: 11168
2026-07-29 08:29:29 +00:00
// Name: action
2026-08-15 05:55:55 +00:00
// Dependencies: [32, 6727, 4994, 676, 4066, 8461, 4092, 7511, 4032, 7427, 5042, 2]
2026-07-20 16:05:17 +00:00
// Exports: handleLegacyCommands
2026-08-15 05:55:55 +00:00
// Module 11167 (action)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import getEmojiToGroupId from "getEmojiToGroupId";
import reinjectEphemerals from "reinjectEphemerals";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import importDefaultResult from "t";
import importDefaultResult1 from "t";
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: closure_6, MARKDOWN_SPOILER_WRAPPER: error, ME: metroImportAll } = ME);
2026-07-23 10:11:24 +00:00
const re9 = /\\([*?+/])/g;
2026-07-29 08:29:29 +00:00
obj = { tts: obj, me: obj, tableflip: obj1, unflip: obj2, shrug: obj3, nick: obj4, reaction: null, searchReplace: null, spoiler: null };
2026-07-20 16:05:17 +00:00
obj = {
action() {
2026-07-29 08:29:29 +00:00
const obj = { tts: null };
2026-08-15 05:55:55 +00:00
const EnableTTSCommand = require(4066) /* explicitContentFromProto */.EnableTTSCommand;
2026-07-29 08:29:29 +00:00
obj[0] = EnableTTSCommand.getSetting();
2026-07-20 16:05:17 +00:00
return obj;
}
};
obj = {
action(arg0) {
return { content: "_" + arg0 + "_" };
}
};
2026-07-29 08:29:29 +00:00
const obj5 = { match: null, action: null };
obj5[0] = require("t").anyScopeRegex(/^\+:(.+?): *$/);
obj5[1] = function action(str, channel) {
channel = channel.channel;
if (!channel.isEdit) {
if (reinjectEphemerals.hasPresent(channel.id)) {
const messages = obj.getMessages(channel.id);
const lastResult = messages.last();
if (null != lastResult) {
if (null != lastResult.id) {
disambiguatedEmojiContext = disambiguatedEmojiContext.getDisambiguatedEmojiContext(channel.guild_id);
const trimmed = str.trim();
const byName = disambiguatedEmojiContext.getByName(trimmed.slice(2, -1));
if (null != byName) {
2026-08-15 05:55:55 +00:00
const obj3 = require(7511) /* checkReactionResponse */;
obj3.addReaction(channel.id, lastResult.id, require(4032) /* MAX_REACTIONS */.toReactionEmoji(byName));
2026-07-29 08:29:29 +00:00
return { content: "" };
2026-07-23 10:11:24 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
obj = reinjectEphemerals;
2026-07-23 10:11:24 +00:00
}
};
2026-07-29 08:29:29 +00:00
obj[6] = obj5;
const obj6 = { match: null, action: null };
2026-07-23 10:11:24 +00:00
obj1 = {
2026-07-20 16:05:17 +00:00
action(arg0) {
2026-07-29 08:29:29 +00:00
const obj = { content: null };
obj[0] = "" + arg0 + " (\u256F\u00B0\u25A1\u00B0)\u256F\uFE35 \u253B\u2501\u253B".trim();
2026-07-20 16:05:17 +00:00
return obj;
}
};
2026-07-23 10:11:24 +00:00
obj2 = {
2026-07-20 16:05:17 +00:00
action(arg0) {
2026-07-29 08:29:29 +00:00
const obj = { content: null };
obj[0] = "" + arg0 + " \u252C\u2500\u252C\u30CE( \u00BA _ \u00BA\u30CE)".trim();
2026-07-20 16:05:17 +00:00
return obj;
}
};
2026-07-23 10:11:24 +00:00
obj3 = {
2026-07-20 16:05:17 +00:00
action(arg0) {
2026-07-29 08:29:29 +00:00
const obj = { content: null };
obj[0] = "" + arg0 + " \u00AF\\_(\u30C4)_/\u00AF".trim();
2026-07-20 16:05:17 +00:00
return obj;
}
};
2026-07-23 10:11:24 +00:00
obj4 = {
2026-07-20 16:05:17 +00:00
action(arg0, channel) {
channel = channel.channel;
if (null != channel.guild_id) {
2026-08-15 05:55:55 +00:00
const obj = importDefault(8461);
2026-07-20 16:05:17 +00:00
obj.changeNickname(channel.guild_id, channel.id, closure_8, arg0);
2026-07-29 08:29:29 +00:00
return { content: "" };
2026-07-20 16:05:17 +00:00
}
}
};
2026-07-29 08:29:29 +00:00
obj6[0] = require("t").anyScopeRegex(/^s\/([^\/\\]*(?:\\.[^\/\\]*)*)\/([^\/\\]*(?:\\.[^\/\\]*)*)(?:\/([g]*))?$/);
obj6[1] = function action(str, channel) {
let str2;
let str3;
2026-07-20 16:05:17 +00:00
channel = channel.channel;
if (!channel.isEdit) {
2026-07-29 08:29:29 +00:00
const lastEditableMessage = reinjectEphemerals.getLastEditableMessage(channel.id);
2026-07-20 16:05:17 +00:00
if (null != lastEditableMessage) {
if (null != lastEditableMessage.id) {
const self = this;
let match = str.match(this.match.regex);
2026-07-29 08:29:29 +00:00
if (match == null) {
2026-07-20 16:05:17 +00:00
match = [];
}
2026-07-29 08:29:29 +00:00
[r10014, str, str2, str3] = callback(Array.from(match), 4);
2026-07-20 16:05:17 +00:00
let parts;
2026-07-29 08:29:29 +00:00
if (str3 != null) {
2026-07-20 16:05:17 +00:00
parts = str3.split("");
}
2026-07-29 08:29:29 +00:00
if (parts == null) {
2026-07-20 16:05:17 +00:00
parts = [];
}
2026-07-29 08:29:29 +00:00
const replaced = str.replace(closure_9, (arg0, arg1) => arg1);
const replaced1 = str2.replace(closure_9, (arg0, arg1) => arg1);
2026-07-20 16:05:17 +00:00
if (parts.includes("g")) {
let str7 = str6.replaceAll(replaced, replaced1);
} else {
str7 = str6.replace(replaced, replaced1);
}
if (null == str7) {
if (0 === lastEditableMessage.attachments.length) {
2026-08-15 05:55:55 +00:00
let obj = importDefault(7427);
2026-07-20 16:05:17 +00:00
obj.deleteMessage(channel.id, lastEditableMessage.id);
}
2026-07-29 08:29:29 +00:00
return { content: "" };
2026-07-20 16:05:17 +00:00
}
if (str7 !== lastEditableMessage.content) {
2026-07-29 08:29:29 +00:00
obj = { content: null };
obj[0] = str7;
2026-08-15 05:55:55 +00:00
importDefault(7427).editMessage(channel.id, lastEditableMessage.id, obj);
const obj2 = importDefault(7427);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp5 = callback(Array.from(match), 4);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return { content: "" };
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
obj[7] = obj6;
obj[8] = {
2026-07-20 16:05:17 +00:00
action(arg0) {
2026-07-29 08:29:29 +00:00
const obj = { content: null };
obj[0] = callback2(arg0).trim();
2026-07-20 16:05:17 +00:00
return obj;
}
};
Object.setPrototypeOf(obj, null);
2026-07-29 08:29:29 +00:00
const result = require("reinjectEphemerals").fileFinishedImporting("modules/messages/LegacyCommands.tsx");
2026-07-20 16:05:17 +00:00
export const COMMANDS = obj;
export const handleLegacyCommands = function handleLegacyCommands(text, arg1) {
2026-07-29 08:29:29 +00:00
for (const key10005 in obj) {
let tmp7 = key10005;
let tmp8 = obj;
let str = obj[key10005];
2026-07-20 16:05:17 +00:00
if (null == str.match) {
continue;
} else {
let regex = str.match.regex;
2026-07-29 08:29:29 +00:00
let isMatch;
if (regex != null) {
isMatch = regex.test(arg0);
}
if (!isMatch) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-29 08:29:29 +00:00
let tmp2 = arg1;
let tmp3 = importDefault;
let tmp4 = dependencyMap;
2026-08-15 05:55:55 +00:00
let obj = importDefault(5042);
2026-07-29 08:29:29 +00:00
let tmp5 = constants;
obj = { command: null };
obj[0] = key10005;
let trackWithMetadataResult = obj.trackWithMetadata(constants.SLASH_COMMAND_USED, obj);
return str.action(arg0, arg1);
2026-07-20 16:05:17 +00:00
}
}
continue;
}
};