From af67ddefa14edb896d63afe026d4736ebf954169 Mon Sep 17 00:00:00 2001 From: dolfies Date: Mon, 22 Apr 2024 19:46:11 -0400 Subject: [PATCH] ShowTimeouts->ShowHiddenThings ~show invite-disabled tooltip too (#2375) --- src/plugins/showHiddenThings/README.md | 11 +++++++ .../index.ts | 32 +++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/plugins/showHiddenThings/README.md rename src/plugins/{showTimeouts => showHiddenThings}/index.ts (51%) diff --git a/src/plugins/showHiddenThings/README.md b/src/plugins/showHiddenThings/README.md new file mode 100644 index 00000000..b41e2d94 --- /dev/null +++ b/src/plugins/showHiddenThings/README.md @@ -0,0 +1,11 @@ +# ShowHiddenThings + +Displays various moderator-only elements regardless of permissions. + +## Features + +- Show member timeout icons in chat +![](https://github.com/Vendicated/Vencord/assets/47677887/75e1f6ba-8921-4188-9c2d-c9c3f9d07101) + +- Show the invites paused tooltip in the server list +![](https://github.com/Vendicated/Vencord/assets/47677887/b6a923d2-ac55-40d9-b4f8-fa6fc117148b) diff --git a/src/plugins/showTimeouts/index.ts b/src/plugins/showHiddenThings/index.ts similarity index 51% rename from src/plugins/showTimeouts/index.ts rename to src/plugins/showHiddenThings/index.ts index b0774bed..e7be929b 100644 --- a/src/plugins/showTimeouts/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -16,20 +16,46 @@ * along with this program. If not, see . */ +import { definePluginSettings, migratePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; +const settings = definePluginSettings({ + showTimeouts: { + type: OptionType.BOOLEAN, + description: "Show member timeout icons in chat.", + default: true, + }, + showInvitesPaused: { + type: OptionType.BOOLEAN, + description: "Show the invites paused tooltip in the server list.", + default: true, + }, +}); + +migratePluginSettings("ShowHiddenThings", "ShowTimeouts"); export default definePlugin({ - name: "ShowTimeouts", - description: "Display member timeout icons in chat regardless of permissions.", + name: "ShowHiddenThings", + tags: ["ShowTimeouts", "ShowInvitesPaused"], + description: "Displays various moderator-only elements regardless of permissions.", authors: [Devs.Dolfies], patches: [ { find: "showCommunicationDisabledStyles", + predicate: () => settings.store.showTimeouts, replacement: { match: /&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/, replace: "", }, }, + { + find: "useShouldShowInvitesDisabledNotif:", + predicate: () => settings.store.showInvitesPaused, + replacement: { + match: /\i\.\i\.can\(\i\.Permissions.MANAGE_GUILD,\i\)/, + replace: "true", + }, + } ], + settings, });