Plugin
FullUserInChatbox
Makes the user mention in the chatbox have more functionalities, like left/right clicking
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import ErrorBoundary from "@components/ErrorBoundary";8
import { Devs } from "@utils/constants";9
import definePlugin from "@utils/types";10
import { findComponentByCodeLazy } from "@webpack";11
import { UserStore, useStateFromStores } from "@webpack/common";12
import { ReactNode } from "react";13
14
const UserMentionComponent = findComponentByCodeLazy(".USER_MENTION)");15
16
interface UserMentionComponentProps {17
id: string;18
channelId: string;19
guildId: string;20
originalComponent: () => ReactNode;21
}22
23
export 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 mentions32
find: 039;"text":"locked"039;,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 <UserMentionComponent47
// This seems to be constant48
className="mention"49
userId={props.id}50
channelId={props.channelId}51
/>;52
}, {53
fallback: ({ wrappedProps: { originalComponent } }) => originalComponent()54
})55
});56