diff --git a/src/plugins/_api/serverList.ts b/src/plugins/_api/serverList.ts index 15a1389f..dfd40de7 100644 --- a/src/plugins/_api/serverList.ts +++ b/src/plugins/_api/serverList.ts @@ -32,9 +32,9 @@ export default definePlugin({ } }, { - find: '#{intl::SERVERS}"]),children', + find: "#{intl::SERVERS}),children", replacement: { - match: /(?<=#{intl::SERVERS}"\]\),children:)\i\.map\(\i\)/, + match: /(?<=#{intl::SERVERS}\),children:)\i\.map\(\i\)/, replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)" } } diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index 6be41d31..1b9ce162 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -149,7 +149,7 @@ export default definePlugin({ patches: [{ find: "#{intl::BEGINNING_DM}", replacement: { - match: /#{intl::BEGINNING_DM}"\],{.+?}\),(?=.{0,300}(\i)\.isMultiUserDM)/, + match: /#{intl::BEGINNING_DM},{.+?}\),(?=.{0,300}(\i)\.isMultiUserDM)/, replace: "$& $self.renderContributorDmWarningCard({ channel: $1 })," } }], diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 47207922..69a7a1a5 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -41,7 +41,7 @@ export default definePlugin({ { find: "DefaultCustomizationSections", replacement: { - match: /(?<=#{intl::USER_SETTINGS_AVATAR_DECORATION}"\]\)},"decoration"\),)/, + match: /(?<=#{intl::USER_SETTINGS_AVATAR_DECORATION}\)},"decoration"\),)/, replace: "$self.DecorSection()," } }, diff --git a/src/plugins/fakeProfileThemes/index.tsx b/src/plugins/fakeProfileThemes/index.tsx index 495d2ddc..bfd1cb99 100644 --- a/src/plugins/fakeProfileThemes/index.tsx +++ b/src/plugins/fakeProfileThemes/index.tsx @@ -128,7 +128,7 @@ export default definePlugin({ { find: "#{intl::USER_SETTINGS_RESET_PROFILE_THEME}", replacement: { - match: /#{intl::USER_SETTINGS_RESET_PROFILE_THEME}"\]\)}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/, + match: /#{intl::USER_SETTINGS_RESET_PROFILE_THEME}\)}\)(?<=color:(\i),.{0,500}?color:(\i),.{0,500}?)/, replace: "$&,$self.addCopy3y3Button({primary:$1,accent:$2})" } } diff --git a/src/plugins/implicitRelationships/index.ts b/src/plugins/implicitRelationships/index.ts index 1f7dbe70..1cde814e 100644 --- a/src/plugins/implicitRelationships/index.ts +++ b/src/plugins/implicitRelationships/index.ts @@ -50,7 +50,7 @@ export default definePlugin({ { find: "#{intl::FRIENDS_SECTION_ONLINE}", replacement: { - match: /(\(0,\i\.jsx\)\(\i\.TabBar\.Item,\{id:\i\.\i)\.BLOCKED,className:([^\s]+?)\.item,children:\i\.\i\.string\(\i\.\i#{intl::BLOCKED}"\]\)\}\)/, + match: /(\(0,\i\.jsx\)\(\i\.TabBar\.Item,\{id:\i\.\i)\.BLOCKED,className:([^\s]+?)\.item,children:\i\.\i\.string\(\i\.\i#{intl::BLOCKED}\)\}\)/, replace: "$1.IMPLICIT,className:$2.item,children:\"Implicit\"}),$&" }, }, diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx index db071e72..6c9102d8 100644 --- a/src/plugins/moreUserTags/index.tsx +++ b/src/plugins/moreUserTags/index.tsx @@ -192,7 +192,7 @@ export default definePlugin({ replacement: [ // make the tag show the right text { - match: /(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=(.{0,40}#{intl::APP_TAG}"\]\))/, + match: /(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=(.{0,40}#{intl::APP_TAG}\))/, replace: (_, origSwitch, variant, tags, displayedText, originalText) => `${origSwitch}default:{${displayedText} = $self.getTagText(${tags}[${variant}],${originalText})}` }, diff --git a/src/plugins/validReply/index.ts b/src/plugins/validReply/index.ts index 4b62f790..989513d0 100644 --- a/src/plugins/validReply/index.ts +++ b/src/plugins/validReply/index.ts @@ -39,7 +39,7 @@ export default definePlugin({ { find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}", replacement: { - match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}"\]\)/, + match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}\)/, replace: "$&,onMouseEnter:()=>$self.fetchReply(arguments[0])" } }, diff --git a/src/utils/patches.ts b/src/utils/patches.ts index 17c541b6..e903b226 100644 --- a/src/utils/patches.ts +++ b/src/utils/patches.ts @@ -25,12 +25,12 @@ export function canonicalizeMatch(match: T): T { const hashed = runtimeHashMessageKey(key); const isString = typeof match === "string"; - const hasSpecialChars = /^[\d]/.test(hashed) || !/^[\w$]+$/.test(hashed); + const hasSpecialChars = !Number.isNaN(Number(hashed[0])) || hashed.includes("+"); if (hasSpecialChars) { return isString - ? `["${hashed}` - : String.raw`(?:\["${hashed})`.replaceAll("+", "\\+"); + ? `["${hashed}"]` + : String.raw`(?:\["${hashed}"\])`.replaceAll("+", "\\+"); } return isString ? `.${hashed}` : String.raw`(?:\.${hashed})`;