diff --git a/src/renderer/coremods/badges/plaintextPatches.ts b/src/renderer/coremods/badges/plaintextPatches.ts index 51c2d05d2..449b58f51 100644 --- a/src/renderer/coremods/badges/plaintextPatches.ts +++ b/src/renderer/coremods/badges/plaintextPatches.ts @@ -3,7 +3,7 @@ import type { PlaintextPatch } from "src/types"; export default [ { // Edit the ProfileBadges component - find: /\.container,\w+\),"aria-label":\w+.\w+\.Messages\.PROFILE_USER_BADGES/, + find: /action:"PRESS_BADGE"/, replacements: [ // Add the "replugged-badge" class if it's our custom badge { diff --git a/src/renderer/coremods/contextMenu/plaintextPatches.ts b/src/renderer/coremods/contextMenu/plaintextPatches.ts index 69533b264..04c5490a8 100644 --- a/src/renderer/coremods/contextMenu/plaintextPatches.ts +++ b/src/renderer/coremods/contextMenu/plaintextPatches.ts @@ -7,7 +7,7 @@ export default [ { match: /((\w+)\){)(var\s*\w+;let{navId:)/, replace: (_, prefix, props, suffix) => - `${prefix}${props}=replugged.coremods.coremods.contextMenu._insertMenuItems(${props});${suffix}`, + `${prefix}${props}=replugged.coremods.coremods.contextMenu?._insertMenuItems(${props});${suffix}`, }, ], }, diff --git a/src/renderer/coremods/language/plaintextPatches.ts b/src/renderer/coremods/language/plaintextPatches.ts index 2f00ec4c7..e1e8ab20c 100644 --- a/src/renderer/coremods/language/plaintextPatches.ts +++ b/src/renderer/coremods/language/plaintextPatches.ts @@ -7,9 +7,8 @@ export default [ find: "getAvailableLocales", replacements: [ { - match: /(\.Messages\.LANGUAGE,)\s*children:((?:[^}]*?}){3}\))/, - replace: (_, prefix, ogChild) => - `${prefix}children:[${coremodStr}?.Card() ?? null,${ogChild}]`, + match: /(\.H1,title:\w+\.intl\.string\(.+?\),children:)((?:[^}]*?}){3}\))/, + replace: (_, prefix, ogChild) => `${prefix}[${coremodStr}?.Card() ?? null,${ogChild}]`, }, { match: /children:\[(.+?\.localeName[^\]]*?)]/, diff --git a/src/renderer/coremods/messagePopover/plaintextPatches.ts b/src/renderer/coremods/messagePopover/plaintextPatches.ts index 7e327b16a..0ba7bf295 100644 --- a/src/renderer/coremods/messagePopover/plaintextPatches.ts +++ b/src/renderer/coremods/messagePopover/plaintextPatches.ts @@ -2,10 +2,10 @@ import type { PlaintextPatch } from "src/types"; export default [ { - find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL", + find: 'navId:"message-actions"', replacements: [ { - match: /(\.Fragment,{children:\[)(.{1,75},{label:\w+\.\w+\.Messages\.COPY_ID_MESSAGE)/, + match: /(\.Fragment,{children:\[)(.{1,75},{label:.{1,100}"copy-id")/, replace: (_, prefix, suffix) => `${prefix}...(replugged.coremods.coremods.messagePopover?._buildPopoverElements(arguments[0]?.message,arguments[0]?.channel) ?? []),${suffix}`, },