diff options
author | Nuckyz <61953774+Nuckyz@users.noreply.github.com> | 2022-12-18 01:13:34 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-18 05:13:34 +0100 |
commit | 4974c53f9cc3a3adccfa11f4af68ac4f190b0fc8 (patch) | |
tree | b33fd7916711a3953526a17be796bdce96200e53 /src | |
parent | 47de9fab2efc4edd29aca46eca87c931607c13dc (diff) | |
download | Vencord-4974c53f9cc3a3adccfa11f4af68ac4f190b0fc8.tar.gz Vencord-4974c53f9cc3a3adccfa11f4af68ac4f190b0fc8.tar.bz2 Vencord-4974c53f9cc3a3adccfa11f4af68ac4f190b0fc8.zip |
Improve PronounDB patch (#348)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/pronoundb/index.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts index 49b25f7..c848110 100644 --- a/src/plugins/pronoundb/index.ts +++ b/src/plugins/pronoundb/index.ts @@ -43,17 +43,10 @@ export default definePlugin({ }, // Hijack the discord pronouns section (hidden without experiment) and add a wrapper around the text section { - find: "currentPronouns:", - all: true, - noWarn: true, + find: ".Messages.BOT_PROFILE_SLASH_COMMANDS", replacement: { - match: /\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^[}]*currentPronouns:[^}]*(\w)\.pronouns[^}]*\})\)/, - replace: (original, PronounComponent, pronounProps, fullProps) => { - // UserSettings - if (pronounProps.includes("onPronounsChange")) return original; - - return `${fullProps}&&Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper(${PronounComponent}, ${pronounProps}, ${fullProps})`; - } + match: /\(0,.\.jsx\)\((?<PronounComponent>.{1,2}\..),(?<pronounProps>{currentPronouns.+?:(?<fullProps>.{1,2})\.pronouns.+?})\)/, + replace: "$<fullProps>&&Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper($<PronounComponent>,$<pronounProps>,$<fullProps>)" } }, // Make pronouns experiment be enabled by default |