1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-26 17:26:22 +00:00
Vencord/src/plugins/notificationVolume/index.ts

36 lines
1,010 B
TypeScript
Raw Normal View History

/*
* Vencord, a Discord client mod
* Copyright (c) 2023 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
const settings = definePluginSettings({
notificationVolume: {
type: OptionType.SLIDER,
description: "Notification volume",
markers: [0, 25, 50, 75, 100],
default: 100,
stickToMarkers: false
}
});
export default definePlugin({
name: "NotificationVolume",
description: "Save your ears and set a separate volume for notifications and in-app sounds",
authors: [Devs.philipbry],
settings,
patches: [
{
find: "_ensureAudio(){",
replacement: {
2024-02-28 02:43:03 +00:00
match: /(?=Math\.min\(\i\.\i\.getOutputVolume\(\)\/100)/,
replace: "$self.settings.store.notificationVolume/100*"
},
},
],
});