Improve PronounDB patch (#348)
This commit is contained in:
parent
47de9fab2e
commit
4974c53f9c
|
@ -43,17 +43,10 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
// Hijack the discord pronouns section (hidden without experiment) and add a wrapper around the text section
|
// Hijack the discord pronouns section (hidden without experiment) and add a wrapper around the text section
|
||||||
{
|
{
|
||||||
find: "currentPronouns:",
|
find: ".Messages.BOT_PROFILE_SLASH_COMMANDS",
|
||||||
all: true,
|
|
||||||
noWarn: true,
|
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^[}]*currentPronouns:[^}]*(\w)\.pronouns[^}]*\})\)/,
|
match: /\(0,.\.jsx\)\((?<PronounComponent>.{1,2}\..),(?<pronounProps>{currentPronouns.+?:(?<fullProps>.{1,2})\.pronouns.+?})\)/,
|
||||||
replace: (original, PronounComponent, pronounProps, fullProps) => {
|
replace: "$<fullProps>&&Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper($<PronounComponent>,$<pronounProps>,$<fullProps>)"
|
||||||
// UserSettings
|
|
||||||
if (pronounProps.includes("onPronounsChange")) return original;
|
|
||||||
|
|
||||||
return `${fullProps}&&Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper(${PronounComponent}, ${pronounProps}, ${fullProps})`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Make pronouns experiment be enabled by default
|
// Make pronouns experiment be enabled by default
|
||||||
|
|
Loading…
Reference in a new issue