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] 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}"]`