From 1176896a1b7aa5615b4aae28cc885683f0dadd1a Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 11 Nov 2022 16:14:05 +0100 Subject: fix(plugins): PronounDB, ViewIcons, WebhookTags, NoBlockedMessages, BetterGifAltText, MessageAccessories --- src/plugins/pronoundb/index.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/plugins/pronoundb/index.ts') 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, -- cgit