Plugin

ShowHiddenThings

Displays various hidden & moderator-only things regardless of permissions.

Servers Utility
index.ts
Download

Source

src/plugins/showHiddenThings/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 { definePluginSettings } from "@api/Settings";
8import { Devs } from "@utils/constants";
9import { Logger } from "@utils/Logger";
10import definePlugin, { OptionType, PluginSettingDef } from "@utils/types";
11import { GuildMember, Role } from "@vencord/discord-types";
12
13const opt = (description: string) => ({
14 type: OptionType.BOOLEAN,
15 description,
16 default: true,
17 restartNeeded: true
18} satisfies PluginSettingDef);
19
20const settings = definePluginSettings({
21 showTimeouts: opt("Show member timeout icons in chat."),
22 showInvitesPaused: opt("Show the invites paused tooltip in the server list."),
23 showModView: opt("Show the member mod view context menu item in all servers.")
24});
25
26export default definePlugin({
27 name: "ShowHiddenThings",
28 searchTerms: ["ShowTimeouts", "ShowInvitesPaused", "ShowModView", "DisableDiscoveryFilters"],
29 description: "Displays various hidden & moderator-only things regardless of permissions.",
30 tags: ["Servers", "Utility"],
31 authors: [Devs.Dolfies],
32 settings,
33
34 patches: [
35 {
36 find: "showCommunicationDisabledStyles",
37 predicate: () => settings.store.showTimeouts,
38 replacement: {
39 match: /&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/,
40 replace: "",
41 },
42 },
43 {
44 find: "INVITES_DISABLED)||",
45 predicate: () => settings.store.showInvitesPaused,
46 replacement: {
47 match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
48 replace: "true",
49 },
50 },
51 {
52 find: /,checkElevated:!1}\),\i\.\i\)}(?<=getCurrentUser\(\);return.+?)/,
53 predicate: () => settings.store.showModView,
54 replacement: {
55 match: /return \i\.\i\(\i\.\i\(\{user:\i,context:\i,checkElevated:!1\}\),\i\.\i\)/,
56 replace: "return true",
57 }
58 },
59 // fixes a bug where Members page must be loaded to see highest role, why is Discord depending on MemberSafetyStore.getEnhancedMember for something that can be obtained here?
60 {
61 find: "#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}),children:",
62 predicate: () => settings.store.showModView,
63 replacement: {
64 match: /(#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}.{0,80})role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+?)/,
65 replace: (_, rest, roles) => `${rest}role:$self.getHighestRole(arguments[0],${roles})`,
66 }
67 },
68 // allows you to open mod view on yourself
69 {
70 find: &#039;action:"PRESS_MOD_VIEW",icon:&#039;,
71 predicate: () => settings.store.showModView,
72 replacement: {
73 match: /\i(?=\?null)/,
74 replace: "false"
75 }
76 }
77 ],
78
79 getHighestRole({ member }: { member: GuildMember; }, roles: Role[]): Role | undefined {
80 try {
81 return roles.find(role => role.id === member.highestRoleId);
82 } catch (e) {
83 new Logger("ShowHiddenThings").error("Failed to find highest role", e);
84 return undefined;
85 }
86 }
87});
88