mirror of
https://github.com/Vendicated/Vencord
synced 2024-09-13 04:29:24 -04:00
altkrispswitch plugin
This commit is contained in:
parent
ca18b6e044
commit
d9e28fc45e
1 changed files with 33 additions and 0 deletions
33
src/plugins/altKrispSwitch/index.ts
Normal file
33
src/plugins/altKrispSwitch/index.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2024 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
||||
export default definePlugin({
|
||||
name: "AltKrispSwitch",
|
||||
description: "Makes the Noise Suppression Popout switch between None and Krisp instead of Krisp and Standard",
|
||||
authors: [Devs.newwares],
|
||||
patches: [
|
||||
{
|
||||
find: ",setNoiseCancellation(",
|
||||
replacement: {
|
||||
match: /(}\),)(.{1,2}\.default\.dispatch\({type:"AUDIO_SET_NOISE_SUPPRESSION",)/,
|
||||
replace: "$1!$self.shouldCancelSuppression(arguments)&&$2"
|
||||
}
|
||||
}
|
||||
],
|
||||
shouldCancelSuppression([enableKrisp, { section: origin }]) {
|
||||
if (origin === "Noise Cancellation Popout") {
|
||||
if (enableKrisp) {
|
||||
return false;
|
||||
} else {
|
||||
// don't enable standard noise suppression if disabling
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in a new issue