aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/pronoundb/index.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-11-11 16:14:05 +0100
committerVendicated <vendicated@riseup.net>2022-11-11 16:14:09 +0100
commit1176896a1b7aa5615b4aae28cc885683f0dadd1a (patch)
treed314a46e6ddcab6e3f328d0a3f535319e7c8f796 /src/plugins/pronoundb/index.ts
parentf3aba3edb0fc67118546629f7dbdda5ff6b0ebff (diff)
downloadVencord-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.ts21
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,