Plugin
UserMessagesPronouns
Adds pronouns to chat user messages
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import { migratePluginSettings } from "@api/Settings";8
import { Devs } from "@utils/constants";9
import definePlugin from "@utils/types";10
11
import { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } from "./PronounsChatComponent";12
import { settings } from "./settings";13
14
migratePluginSettings("UserMessagesPronouns", "PronounDB");15
export default definePlugin({16
name: "UserMessagesPronouns",17
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven, Devs.Elvyra],18
description: "Adds pronouns to chat user messages",19
tags: ["Chat", "Appearance"],20
settings,21
22
patches: [23
{24
find: "showCommunicationDisabledStyles",25
replacement: {26
// Add next to timestamp (normal mode)27
match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,28
replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"29
}30
},31
{32
find: 039;="SYSTEM_TAG"039;,33
replacement: [34
{35
// Add next to username (compact mode)36
match: /className:\i\(\)\(\i\.className(?:,\i\.\i)?,\i\)\}\)(?:\))?,(?=\i)/g,37
replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),",38
},39
]40
}41
],42
43
PronounsChatComponentWrapper,44
CompactPronounsChatComponentWrapper,45
});46