Plugin
AlwaysExpandRoles
Always expands the role list in profile popouts
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import { migratePluginSettings } from "@api/Settings";8
import { Devs } from "@utils/constants";9
import definePlugin from "@utils/types";10
11
migratePluginSettings("AlwaysExpandRoles", "ShowAllRoles");12
export 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 occur28
match: /(?<=useLayoutEffect\(\(\)=>\{if\()\i/,29
replace: "false"30
}31
]32
}33
]34
});35