Plugin

UserMessagesPronouns

Adds pronouns to chat user messages

Chat Appearance
index.ts
Download

Source

src/plugins/userMessagesPronouns/index.ts
1/*
2 * FiveCord — a Discord client mod
3 * Copyright (c) 2025 FiveCord
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7import { migratePluginSettings } from "@api/Settings";
8import { Devs } from "@utils/constants";
9import definePlugin from "@utils/types";
10
11import { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } from "./PronounsChatComponent";
12import { settings } from "./settings";
13
14migratePluginSettings("UserMessagesPronouns", "PronounDB");
15export 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