From a09a3a8a8f1cf6952e3e1dc9ca2b16ee2994c6eb Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 6 Nov 2024 04:00:38 -0500 Subject: [PATCH 1/8] Some To-Do Stuff --- src/equicordplugins/iRememberYou/index.tsx | 9 +++++++-- src/equicordplugins/themeLibrary/index.tsx | 8 +++++++- src/plugins/_core/settings.tsx | 7 +++++++ 3 files changed, 21 insertions(+), 3 deletions(-) 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/themeLibrary/index.tsx b/src/equicordplugins/themeLibrary/index.tsx index 59b26b9f..ae565eda 100644 --- a/src/equicordplugins/themeLibrary/index.tsx +++ b/src/equicordplugins/themeLibrary/index.tsx @@ -36,7 +36,13 @@ export default definePlugin({ id: "ThemeSection", }); - customSettingsSections.push(ThemeSection); + customSettingsSections.push(_ => ({ + section: "ThemeLibrary", + label: "Theme Library", + searchableTitles: ["Theme Library"], + element: require("./components/ThemeTab").default, + id: "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" }, From 26c7feaa391162f0a718fdcb6684a32949621619 Mon Sep 17 00:00:00 2001 From: nexpid <60316309+nexpid@users.noreply.github.com> Date: Wed, 6 Nov 2024 20:42:48 +0100 Subject: [PATCH 2/8] feat(LoginWithQR): Update (#93) * fix: fix loginwithqr + devcompanion lazy fix * Description One Line --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> --- src/equicordplugins/loginWithQR/index.tsx | 2 +- src/plugins/devCompanion/initWs.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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); From 05bef94b343e580c7c996b2951881f09dd3a691f Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:39:07 -0500 Subject: [PATCH 3/8] Some Fixes Credit to sadan4 --- src/components/VencordSettings/PatchHelperTab.tsx | 2 +- src/equicordplugins/themeLibrary/index.tsx | 8 -------- src/plugins/betterFolders/index.tsx | 14 +++++++------- src/plugins/typingTweaks/index.tsx | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) 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/equicordplugins/themeLibrary/index.tsx b/src/equicordplugins/themeLibrary/index.tsx index ae565eda..e137a60b 100644 --- a/src/equicordplugins/themeLibrary/index.tsx +++ b/src/equicordplugins/themeLibrary/index.tsx @@ -28,14 +28,6 @@ export default definePlugin({ } ).customSections; - const ThemeSection = () => ({ - section: "ThemeLibrary", - label: "Theme Library", - searchableTitles: ["Theme Library"], - element: require("./components/ThemeTab").default, - id: "ThemeSection", - }); - customSettingsSections.push(_ => ({ section: "ThemeLibrary", label: "Theme Library", 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/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 ); From 2270b88a98baf31cdd6fb5db429304048bc15515 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:52:26 -0300 Subject: [PATCH 4/8] intl macro: Support raw hash --- src/utils/patches.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/patches.ts b/src/utils/patches.ts index 3812acd9..097c6456 100644 --- a/src/utils/patches.ts +++ b/src/utils/patches.ts @@ -21,8 +21,8 @@ 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("/"); @@ -40,7 +40,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; } From 225c99ad4c784b2ba467f2f2b4b934e0579f55c6 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:53:46 -0500 Subject: [PATCH 5/8] NoAppsAllowed Fix --- src/equicordplugins/noAppsAllowed/index.tsx | 6 +++--- src/plugins/moreUserTags/index.tsx | 4 +--- src/utils/patches.ts | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) 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/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/utils/patches.ts b/src/utils/patches.ts index 097c6456..24b48ab6 100644 --- a/src/utils/patches.ts +++ b/src/utils/patches.ts @@ -27,6 +27,8 @@ export function canonicalizeMatch(match: T): T { 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}"]` From d08ca66fc193223ace3f257bc4c827f90ed42a12 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:18:43 -0500 Subject: [PATCH 6/8] fix animated emojis credit to sadan4 --- src/plugins/fakeNitro/index.tsx | 3 +++ 1 file changed, 3 insertions(+) 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); From f76aff3ebf08ca222fd9cf236cc101bf32204e13 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:05:43 -0500 Subject: [PATCH 7/8] Move Updater Buttons --- src/components/VencordSettings/UpdaterTab.tsx | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/components/VencordSettings/UpdaterTab.tsx b/src/components/VencordSettings/UpdaterTab.tsx index 50183c9c..7090d3e2 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 &&