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

main
dolfies 5 months ago committed by GitHub
parent 8f73b9fd5f
commit af67ddefa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

@ -16,20 +16,46 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants"; 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({ export default definePlugin({
name: "ShowTimeouts", name: "ShowHiddenThings",
description: "Display member timeout icons in chat regardless of permissions.", tags: ["ShowTimeouts", "ShowInvitesPaused"],
description: "Displays various moderator-only elements regardless of permissions.",
authors: [Devs.Dolfies], authors: [Devs.Dolfies],
patches: [ patches: [
{ {
find: "showCommunicationDisabledStyles", find: "showCommunicationDisabledStyles",
predicate: () => settings.store.showTimeouts,
replacement: { replacement: {
match: /&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/, match: /&&\i\.\i\.canManageUser\(\i\.\i\.MODERATE_MEMBERS,\i\.author,\i\)/,
replace: "", replace: "",
}, },
}, },
{
find: "useShouldShowInvitesDisabledNotif:",
predicate: () => settings.store.showInvitesPaused,
replacement: {
match: /\i\.\i\.can\(\i\.Permissions.MANAGE_GUILD,\i\)/,
replace: "true",
},
}
], ],
settings,
}); });
Loading…
Cancel
Save