PronounDB: Fix on user profiles

This commit is contained in:
Nuckyz 2024-08-23 18:41:34 -03:00
parent 8afcb8e4dd
commit f0e6986835
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
3 changed files with 29 additions and 27 deletions

View file

@ -26,11 +26,6 @@ import { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } fro
import { useProfilePronouns } from "./pronoundbUtils";
import { settings } from "./settings";
const PRONOUN_TOOLTIP_PATCH = {
match: /text:(.{0,10}.Messages\.USER_PROFILE_PRONOUNS)(?=,)/,
replace: '$& + (typeof vcPronounSource !== "undefined" ? ` (${vcPronounSource})` : "")'
};
export default definePlugin({
name: "PronounDB",
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven, Devs.Elvyra],
@ -52,7 +47,24 @@ export default definePlugin({
]
},
// @TODO Patch discord pronoun hook in user profiles (useProfilePronouns)
{
find: ".Messages.USER_PROFILE_PRONOUNS",
group: true,
replacement: [
{
match: /\.PANEL},/,
replace: "$&[vcPronoun,vcPronounSource,vcHasPendingPronouns]=$self.useProfilePronouns(arguments[0].user?.id),"
},
{
match: /text:\i\.\i.Messages.USER_PROFILE_PRONOUNS/,
replace: '$&+vcHasPendingPronouns?"":` (${vcPronounSource})`'
},
{
match: /(\.pronounsText.+?children:)(\i)/,
replace: "$1vcHasPendingPronouns?$2:vcPronoun"
}
]
}
],
settings,