Plugin

AlwaysExpandRoles

Always expands the role list in profile popouts

Appearance Roles
index.ts
Download

Source

src/plugins/alwaysExpandRoles/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
11migratePluginSettings("AlwaysExpandRoles", "ShowAllRoles");
12export default definePlugin({
13 name: "AlwaysExpandRoles",
14 description: "Always expands the role list in profile popouts",
15 tags: ["Appearance", "Roles"],
16 authors: [Devs.surgedevs],
17 patches: [
18 {
19 find: "hasDeveloperContextMenu:",
20 replacement: [
21 {
22 match: /(?<=\?\i\.current\[\i\].{0,100}?)useState\(!1\)/,
23 replace: "useState(!0)"
24 },
25 {
26 // Fix not calculating non-expanded roles because the above patch makes the default "expanded",
27 // which makes the collapse button never show up and calculation never occur
28 match: /(?<=useLayoutEffect\(\(\)=>\{if\()\i/,
29 replace: "false"
30 }
31 ]
32 }
33 ]
34});
35