fix pronoundb
This commit is contained in:
parent
59fc922aee
commit
00427c53d8
1 changed files with 13 additions and 14 deletions
|
@ -36,25 +36,24 @@ export default definePlugin({
|
||||||
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],
|
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],
|
||||||
description: "Adds pronouns to user messages using pronoundb",
|
description: "Adds pronouns to user messages using pronoundb",
|
||||||
patches: [
|
patches: [
|
||||||
// Add next to username (compact mode)
|
|
||||||
{
|
{
|
||||||
find: "showCommunicationDisabledStyles",
|
find: "showCommunicationDisabledStyles",
|
||||||
replacement: {
|
replacement: [
|
||||||
match: /("span",{id:\i,className:\i,children:\i}\))/,
|
// Add next to username (compact mode)
|
||||||
replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"
|
{
|
||||||
}
|
match: /("span",{id:\i,className:\i,children:\i}\))/,
|
||||||
},
|
replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"
|
||||||
// Patch the chat timestamp element (normal mode)
|
},
|
||||||
{
|
// Patch the chat timestamp element (normal mode)
|
||||||
find: "showCommunicationDisabledStyles",
|
{
|
||||||
replacement: {
|
match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,
|
||||||
match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,
|
replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"
|
||||||
replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"
|
}
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
// Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns
|
// Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns
|
||||||
{
|
{
|
||||||
find: ".userTagNoNickname",
|
find: ".pronouns,children",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,
|
match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,
|
||||||
|
|
Loading…
Reference in a new issue