decord/source/modules/messages/LegacyCommands.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

179 lines
5.7 KiB
TypeScript

// Module ID: 11996
// Function ID: 11997
// Name: action
// Dependencies: [32, 5459, 4781, 1074, 1935, 9303, 4257, 7764, 4211, 7456, 4740, 2]
// Exports: handleLegacyCommands
// Module 11996 (action)
import explicitContentFromProto from "explicitContentFromProto" /* 1935 */;
import MAX_REACTIONS from "MAX_REACTIONS" /* 4211 */;
import collectGuildAnalyticsMetadataDefault from "collectGuildAnalyticsMetadata" /* 4740 */;
import trackInviteDefault from "trackInvite" /* 7456 */;
import checkReactionResponse from "checkReactionResponse" /* 7764 */;
import _modDef9303 from "module_9303" /* 9303 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "getEmojiToGroupId" /* 5459 */;
import closure_5 from "reinjectEphemerals" /* 4781 */;
import ME from "ME" /* 1074 */;
import importDefaultResult from "t" /* 4257 */;
require = arg1;
({ AnalyticEvents: closure_6, MARKDOWN_SPOILER_WRAPPER: error, ME: closure_8 } = ME);
const re9 = /\\([*?+/])/g;
obj = { tts: obj, me: obj, tableflip: obj1, unflip: obj2, shrug: obj3, nick: obj4, reaction: null, searchReplace: null, spoiler: null };
obj = {
action() {
obj = { tts: null };
const EnableTTSCommand = explicitContentFromProto.EnableTTSCommand;
obj[0] = EnableTTSCommand.getSetting();
return obj;
}
};
obj = {
action(arg0) {
return { content: "_" + arg0 + "_" };
}
};
const obj5 = {
match: importDefaultResult.anyScopeRegex(/^\+:(.+?): *$/),
action(str, channel) {
channel = channel.channel;
if (!channel.isEdit) {
if (closure_5.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) {
const obj3 = checkReactionResponse;
obj3.addReaction(channel.id, lastResult.id, MAX_REACTIONS.toReactionEmoji(byName));
return { content: "" };
}
}
}
}
obj = closure_5;
}
}
};
obj[6] = obj5;
const obj6 = { match: null, action: null };
obj1 = {
action(arg0) {
obj = { content: "" + arg0 + " (\u256F\u00B0\u25A1\u00B0)\u256F\uFE35 \u253B\u2501\u253B".trim() };
return obj;
}
};
obj2 = {
action(arg0) {
obj = { content: "" + arg0 + " \u252C\u2500\u252C\u30CE( \u00BA _ \u00BA\u30CE)".trim() };
return obj;
}
};
obj3 = {
action(arg0) {
obj = { content: "" + arg0 + " \u00AF\\_(\u30C4)_/\u00AF".trim() };
return obj;
}
};
obj4 = {
action(arg0, channel) {
channel = channel.channel;
if (null != channel.guild_id) {
obj = _modDef9303;
obj.changeNickname(channel.guild_id, channel.id, closure_8, arg0);
return { content: "" };
}
}
};
obj6[0] = importDefaultResult.anyScopeRegex(/^s\/([^\/\\]*(?:\\.[^\/\\]*)*)\/([^\/\\]*(?:\\.[^\/\\]*)*)(?:\/([g]*))?$/);
obj6[1] = function action(str, channel) {
channel = channel.channel;
if (!channel.isEdit) {
const lastEditableMessage = closure_5.getLastEditableMessage(channel.id);
if (null != lastEditableMessage) {
if (null != lastEditableMessage.id) {
const self = this;
let match = str.match(this.match.regex);
if (match == null) {
match = [];
}
[r10014, str, str2, str3] = callback(Array.from(match), 4);
let parts;
if (str3 != null) {
parts = str3.split("");
}
if (parts == null) {
parts = [];
}
const replaced = str.replace(closure_9, (arg0, arg1) => arg1);
const replaced1 = str2.replace(closure_9, (arg0, arg1) => arg1);
if (parts.includes("g")) {
let str7 = str6.replaceAll(replaced, replaced1);
} else {
str7 = str6.replace(replaced, replaced1);
}
if (null == str7) {
if (0 === lastEditableMessage.attachments.length) {
obj = trackInviteDefault;
obj.deleteMessage(channel.id, lastEditableMessage.id);
}
return { content: "" };
}
if (str7 !== lastEditableMessage.content) {
obj = { content: null };
obj[0] = str7;
trackInviteDefault.editMessage(channel.id, lastEditableMessage.id, obj);
const obj2 = trackInviteDefault;
}
const tmp5 = callback(Array.from(match), 4);
}
}
return { content: "" };
}
};
obj[7] = obj6;
obj[8] = {
action(arg0) {
obj = { content: callback2(arg0).trim() };
return obj;
}
};
Object.setPrototypeOf(obj, null);
const importDefaultResult1 = importDefaultResult;
const result = require("set").fileFinishedImporting("modules/messages/LegacyCommands.tsx");
export const COMMANDS = obj;
export const handleLegacyCommands = function handleLegacyCommands(text, arg1) {
for (const key10005 in obj) {
let tmp7 = key10005;
let tmp8 = obj;
let str = obj[key10005];
if (null == str.match) {
continue;
} else {
let regex = str.match.regex;
let isMatch;
if (regex != null) {
isMatch = regex.test(arg0);
}
if (!isMatch) {
continue;
} else {
let tmp2 = arg1;
let tmp3 = importDefault;
let tmp4 = dependencyMap;
obj = collectGuildAnalyticsMetadataDefault;
let tmp5 = constants;
obj = { command: null };
obj[0] = key10005;
let trackWithMetadataResult = obj.trackWithMetadata(constants.SLASH_COMMAND_USED, obj);
return str.action(arg0, arg1);
}
}
continue;
}
};