ShowTimeouts->ShowHiddenThings ~show invite-disabled tooltip too (#2375)

This commit is contained in:
dolfies 2024-04-22 19:46:11 -04:00 committed by GitHub
parent 8f73b9fd5f
commit af67ddefa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 3 deletions

View file

@ -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)

View file

@ -16,20 +16,46 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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,
});