Plugin

UserMessagesPronouns

Adds pronouns to chat user messages

Chat Appearance
index.ts
Download

Source

src/plugins/userMessagesPronouns/index.ts
1import { migratePluginSettings } from "@api/Settings";
2import { Devs } from "@utils/constants";
3import definePlugin from "@utils/types";
4
5import { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } from "./PronounsChatComponent";
6import { settings } from "./settings";
7
8migratePluginSettings("UserMessagesPronouns", "PronounDB");
9export default definePlugin({
10 name: "UserMessagesPronouns",
11 authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven, Devs.Elvyra],
12 description: "Adds pronouns to chat user messages",
13 tags: ["Chat", "Appearance"],
14 settings,
15
16 patches: [
17 {
18 find: "showCommunicationDisabledStyles",
19 replacement: {
20 // Add next to timestamp (normal mode)
21 match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,
22 replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"
23 }
24 },
25 {
26 find: &#039;="SYSTEM_TAG"&#039;,
27 replacement: [
28 {
29 // Add next to username (compact mode)
30 match: /className:\i\(\)\(\i\.className(?:,\i\.\i)?,\i\)\}\)(?:\))?,(?=\i)/g,
31 replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),",
32 },
33 ]
34 }
35 ],
36
37 PronounsChatComponentWrapper,
38 CompactPronounsChatComponentWrapper,
39});
40