diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-11 16:14:05 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-11 16:14:09 +0100 |
commit | 1176896a1b7aa5615b4aae28cc885683f0dadd1a (patch) | |
tree | d314a46e6ddcab6e3f328d0a3f535319e7c8f796 /src/plugins/pronoundb/index.ts | |
parent | f3aba3edb0fc67118546629f7dbdda5ff6b0ebff (diff) | |
download | Vencord-1176896a1b7aa5615b4aae28cc885683f0dadd1a.tar.gz Vencord-1176896a1b7aa5615b4aae28cc885683f0dadd1a.tar.bz2 Vencord-1176896a1b7aa5615b4aae28cc885683f0dadd1a.zip |
fix(plugins): PronounDB, ViewIcons, WebhookTags, NoBlockedMessages, BetterGifAltText, MessageAccessories
Diffstat (limited to 'src/plugins/pronoundb/index.ts')
-rw-r--r-- | src/plugins/pronoundb/index.ts | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts index 5dfeda5..121e0d6 100644 --- a/src/plugins/pronoundb/index.ts +++ b/src/plugins/pronoundb/index.ts @@ -44,13 +44,28 @@ export default definePlugin({ }, // Hijack the discord pronouns section (hidden without experiment) and add a wrapper around the text section { - find: ".headerTagUsernameNoNickname", + find: "currentPronouns:", + all: true, replacement: { - match: /(?<=""!==(.{1,2})&&).+?children:\1.+?(?=,)/, - replace: "Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper(e, $1)" + match: /\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^[}]*currentPronouns:[^}]*(\w)\.pronouns[^}]*\})\)/, + replace: (original, PronounComponent, pronounProps, fullProps) => { + // UserSettings + if (fullProps.includes("onPronounsChange")) return original; + + return `Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper(${PronounComponent}, ${pronounProps}, ${fullProps})`; + } + } + }, + // Make pronouns experiment be enabled by default + { + find: "2022-01_pronouns", + replacement: { + match: "!1", // false + replace: "!0" } } ], + options: { pronounsFormat: { type: OptionType.SELECT, |