diff --git a/src/components/VencordSettings/PatchHelperTab.tsx b/src/components/VencordSettings/PatchHelperTab.tsx index 03626bf3..2fed19b6 100644 --- a/src/components/VencordSettings/PatchHelperTab.tsx +++ b/src/components/VencordSettings/PatchHelperTab.tsx @@ -244,7 +244,7 @@ function FullPatchInput({ setFind, setParsedFind, setMatch, setReplacement }: Fu } try { - const parsed = (0, eval)(`(${fullPatch})`) as Patch; + const parsed = (0, eval)(`([${fullPatch}][0])`) as Patch; if (!parsed.find) throw new Error("No 'find' field"); if (!parsed.replacement) throw new Error("No 'replacement' field"); diff --git a/src/components/VencordSettings/UpdaterTab.tsx b/src/components/VencordSettings/UpdaterTab.tsx index 50183c9c..7558b728 100644 --- a/src/components/VencordSettings/UpdaterTab.tsx +++ b/src/components/VencordSettings/UpdaterTab.tsx @@ -111,21 +111,6 @@ function Updatable(props: CommonProps) { return ( <> - {!updates && updateError ? ( - <> - Failed to check updates. Check the console for more info - - {updateError.stderr || updateError.stdout || "An unknown error occurred"} - - > - ) : ( - - {isOutdated ? (updates.length === 1 ? "There is 1 Update" : `There are ${updates.length} Updates`) : "Up to Date!"} - - )} - - {isOutdated && } - {isOutdated && + {!updates && updateError ? ( + <> + Failed to check updates. Check the console for more info + + {updateError.stderr || updateError.stdout || "An unknown error occurred"} + + > + ) : ( + + {isOutdated ? (updates.length === 1 ? "There is 1 Update" : `There are ${updates.length} Updates`) : "Up to Date!"} + + )} + + {isOutdated && } > ); } diff --git a/src/equicordplugins/iRememberYou/index.tsx b/src/equicordplugins/iRememberYou/index.tsx index 52de570b..b72c0bf0 100644 --- a/src/equicordplugins/iRememberYou/index.tsx +++ b/src/equicordplugins/iRememberYou/index.tsx @@ -366,8 +366,13 @@ export default definePlugin({ ); data.storageAutoSaveProtocol(); - // @ts-ignore - Vencord.Plugins.plugins.Settings.customSections.push(ID => ({ + const customSettingsSections = ( + Vencord.Plugins.plugins.Settings as any as { + customSections: ((ID: Record) => any)[]; + } + ).customSections; + + customSettingsSections.push(_ => ({ section: "iremeberyou.display-data", label: "IRememberYou", element: () => ui.toElement(data.usersCollection), diff --git a/src/equicordplugins/loginWithQR/index.tsx b/src/equicordplugins/loginWithQR/index.tsx index 955576ab..396513e2 100644 --- a/src/equicordplugins/loginWithQR/index.tsx +++ b/src/equicordplugins/loginWithQR/index.tsx @@ -59,7 +59,7 @@ export default definePlugin({ replacement: { // Find the Edit User Profile button and insert our custom button. // A bit jank, but whatever - match: /,(.{0,20}\.Button,.{0,100}#{intl::USER_SETTINGS_EDIT_USER_PROFILE}\)}\))/, + match: /,(\(.{1,90}#{intl::USER_SETTINGS_EDIT_USER_PROFILE}\)}\))/, replace: ",$self.insertScanQrButton($1)", }, }, diff --git a/src/equicordplugins/noAppsAllowed/index.tsx b/src/equicordplugins/noAppsAllowed/index.tsx index 70b1443c..a97c2864 100644 --- a/src/equicordplugins/noAppsAllowed/index.tsx +++ b/src/equicordplugins/noAppsAllowed/index.tsx @@ -14,10 +14,10 @@ export default definePlugin({ patches: [ { - find: "#{intl::APP_TAG})", + find: "#{intl::APP_TAG::hash}\":", replacement: { - match: /\i\.\i\.string\(\i\.\i#{intl::APP_TAG}\)/, - replace: '"BOT"' + match: /(#{intl::APP_TAG::hash}"):".*?"/, + replace: '$1:"BOT"' } } ], diff --git a/src/equicordplugins/themeLibrary/index.tsx b/src/equicordplugins/themeLibrary/index.tsx index 59b26b9f..e137a60b 100644 --- a/src/equicordplugins/themeLibrary/index.tsx +++ b/src/equicordplugins/themeLibrary/index.tsx @@ -28,15 +28,13 @@ export default definePlugin({ } ).customSections; - const ThemeSection = () => ({ + customSettingsSections.push(_ => ({ section: "ThemeLibrary", label: "Theme Library", searchableTitles: ["Theme Library"], element: require("./components/ThemeTab").default, id: "ThemeSection", - }); - - customSettingsSections.push(ThemeSection); + })); }, stop() { diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 4c49a2a2..2e362dc3 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -103,42 +103,49 @@ export default definePlugin({ { section: "EquicordSettings", label: "Equicord", + searchableTitles: ["Equicord", "Settings", "Equicord Settings"], element: VencordTab, className: "vc-settings" }, { section: "EquicordPlugins", label: "Plugins", + searchableTitles: ["Plugins"], element: PluginsTab, className: "vc-plugins" }, { section: "EquicordThemes", label: "Themes", + searchableTitles: ["Themes"], element: require("@components/ThemeSettings/ThemesTab").default, className: "vc-themes" }, !IS_UPDATER_DISABLED && { section: "EquicordUpdater", label: "Updater", + searchableTitles: ["Updater"], element: UpdaterTab, className: "vc-updater" }, { section: "EquicordCloud", label: "Cloud", + searchableTitles: ["Cloud"], element: CloudTab, className: "vc-cloud" }, { section: "EquicordSettingsSync", label: "Backup & Restore", + searchableTitles: ["Backup & Restore"], element: BackupAndRestoreTab, className: "vc-backup-restore" }, { section: "EquicordPatchHelper", label: "Patch Helper", + searchableTitles: ["Patch Helper"], element: PatchHelperTab, className: "vc-patch-helper" }, diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index 50dee4f5..d3e7af73 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -275,16 +275,16 @@ export default definePlugin({ }, makeGuildsBarGuildListFilter(isBetterFolders: boolean) { - try { - return child => { - if (isBetterFolders) { + return child => { + if (isBetterFolders) { + try { return child?.props?.["aria-label"] === getIntlMessage("SERVERS"); + } catch (e) { + console.error(e); } - return true; - }; - } catch { + } return true; - } + }; }, makeGuildsBarTreeFilter(isBetterFolders: boolean) { diff --git a/src/plugins/devCompanion/initWs.tsx b/src/plugins/devCompanion/initWs.tsx index 0a048666..364f7875 100644 --- a/src/plugins/devCompanion/initWs.tsx +++ b/src/plugins/devCompanion/initWs.tsx @@ -282,11 +282,11 @@ export function initWs(isManual = false) { const { find, replacement } = data as PatchData; let candidates; - if (data.findType === FindType.STRING) - candidates = search(find.toString()); + if (data.findType === FindType.REGEX) + candidates = search(...mkRegexFind(find)); else - candidates = search(...mkRegexFind(find)); + candidates = search(find.toString()); // const candidates = search(find); const keys = Object.keys(candidates); diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 3fb1468d..45f42dcf 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -928,6 +928,9 @@ export default definePlugin({ const url = new URL(IconUtils.getEmojiURL({ id: emoji.id, animated: emoji.animated, size: s.emojiSize })); url.searchParams.set("size", s.emojiSize.toString()); url.searchParams.set("name", emoji.name); + if (emoji.animated) { + url.pathname = url.pathname.replace(".webp", ".gif"); + } const linkText = s.hyperLinkText.replaceAll("{{NAME}}", emoji.name); diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx index d78c82b1..6c9102d8 100644 --- a/src/plugins/moreUserTags/index.tsx +++ b/src/plugins/moreUserTags/index.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { definePluginSettings, Settings } from "@api/Settings"; +import { definePluginSettings } from "@api/Settings"; import { Flex } from "@components/Flex"; import { Devs } from "@utils/constants"; import { getIntlMessage } from "@utils/discord"; @@ -301,7 +301,6 @@ export default definePlugin({ const [tagName, variant] = passedTagName.split("-"); if (!passedTagName) return getIntlMessage("APP_TAG"); const tag = tags.find(({ name }) => tagName === name); - if (!tag && Settings.plugins.NoAppsAllowed.enabled) return "BOT"; if (!tag) return getIntlMessage("APP_TAG"); if (variant === "BOT" && tagName !== "WEBHOOK" && this.settings.store.dontShowForBots) return getIntlMessage("APP_TAG"); @@ -310,7 +309,6 @@ export default definePlugin({ case "OP": return `${getIntlMessage("BOT_TAG_FORUM_ORIGINAL_POSTER")} • ${tagText}`; case "BOT": - if (Settings.plugins.NoAppsAllowed.enabled) return `BOT • ${tagText}`; return `${getIntlMessage("APP_TAG")} • ${tagText}`; default: return tagText; diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 4fb3c775..2b529373 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -134,7 +134,7 @@ export default definePlugin({ let element = 0; return children.map(c => - c.type === "strong" + c.type === "strong" || (typeof c !== "string" && !React.isValidElement(c)) ? : c ); diff --git a/src/utils/patches.ts b/src/utils/patches.ts index 3812acd9..24b48ab6 100644 --- a/src/utils/patches.ts +++ b/src/utils/patches.ts @@ -21,12 +21,14 @@ import { Patch, PatchReplacement, ReplaceFn } from "./types"; export function canonicalizeMatch(match: T): T { let partialCanon = typeof match === "string" ? match : match.source; - partialCanon = partialCanon.replaceAll(/#{intl::([A-Za-z_$][\w$]*)}/g, (_, key) => { - const hashed = runtimeHashMessageKey(key); + partialCanon = partialCanon.replaceAll(/#{intl::([\w$+/]*)(?:::(\w+))?}/g, (_, key, modifier) => { + const hashed = modifier === "raw" ? key : runtimeHashMessageKey(key); const isString = typeof match === "string"; const hasSpecialChars = !Number.isNaN(Number(hashed[0])) || hashed.includes("+") || hashed.includes("/"); + if (modifier === "hash") return hashed; + if (hasSpecialChars) { return isString ? `["${hashed}"]` @@ -40,7 +42,7 @@ export function canonicalizeMatch(match: T): T { return partialCanon as T; } - const canonSource = partialCanon.replaceAll(String.raw`\i`, String.raw`(?:[A-Za-z_$][\w$]*)`); + const canonSource = partialCanon.replaceAll("\\i", String.raw`(?:[A-Za-z_$][\w$]*)`); return new RegExp(canonSource, match.flags) as T; }
{updateError.stderr || updateError.stdout || "An unknown error occurred"}