Plugin

FullUserInChatbox

Makes the user mention in the chatbox have more functionalities, like left/right clicking

Shortcuts Utility
index.tsx
Download

Source

src/plugins/fullUserInChatbox/index.tsx
1/*
2 * FiveCord — a Discord client mod
3 * Copyright (c) 2025 FiveCord
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7import ErrorBoundary from "@components/ErrorBoundary";
8import { Devs } from "@utils/constants";
9import definePlugin from "@utils/types";
10import { findComponentByCodeLazy } from "@webpack";
11import { UserStore, useStateFromStores } from "@webpack/common";
12import { ReactNode } from "react";
13
14const UserMentionComponent = findComponentByCodeLazy(".USER_MENTION)");
15
16interface UserMentionComponentProps {
17 id: string;
18 channelId: string;
19 guildId: string;
20 originalComponent: () => ReactNode;
21}
22
23export default definePlugin({
24 name: "FullUserInChatbox",
25 description: "Makes the user mention in the chatbox have more functionalities, like left/right clicking",
26 tags: ["Shortcuts", "Utility"],
27 authors: [Devs.sadan],
28
29 patches: [
30 {
31 // Same find as RoleColorEverywhere chatbox mentions
32 find: '"text":"locked"',
33 replacement: {
34 match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/,
35 replace: "$1return $self.UserMentionComponent({...arguments[0],originalComponent:()=>{$2}});"
36 }
37 }
38 ],
39
40 UserMentionComponent: ErrorBoundary.wrap((props: UserMentionComponentProps) => {
41 const user = useStateFromStores([UserStore], () => UserStore.getUser(props.id));
42 if (user == null) {
43 return props.originalComponent();
44 }
45
46 return <UserMentionComponent
47 // This seems to be constant
48 className="mention"
49 userId={props.id}
50 channelId={props.channelId}
51 />;
52 }, {
53 fallback: ({ wrappedProps: { originalComponent } }) => originalComponent()
54 })
55});
56