From 00427c53d8dbac36584736bd30a376e61b860c78 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 14 Apr 2024 01:50:18 +0200 Subject: [PATCH] fix pronoundb --- src/plugins/pronoundb/index.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts index b1e74158b..61edd191e 100644 --- a/src/plugins/pronoundb/index.ts +++ b/src/plugins/pronoundb/index.ts @@ -36,25 +36,24 @@ export default definePlugin({ authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven], description: "Adds pronouns to user messages using pronoundb", patches: [ - // Add next to username (compact mode) { find: "showCommunicationDisabledStyles", - replacement: { - match: /("span",{id:\i,className:\i,children:\i}\))/, - replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])" - } - }, - // Patch the chat timestamp element (normal mode) - { - find: "showCommunicationDisabledStyles", - replacement: { - match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/, - replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]" - } + replacement: [ + // Add next to username (compact mode) + { + match: /("span",{id:\i,className:\i,children:\i}\))/, + replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])" + }, + // Patch the chat timestamp element (normal mode) + { + match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/, + replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]" + } + ] }, // Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns { - find: ".userTagNoNickname", + find: ".pronouns,children", replacement: [ { match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,