Equicord/src/equicordplugins/blockKrisp/index.ts
2026-04-19 13:29:09 -04:00

42 lines
1.2 KiB
TypeScript

/*
* 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 { t } from "@utils/translation";
import definePlugin from "@utils/types";
export default definePlugin({
name: "BlockKrisp",
description: t("equicord.blockKrisp.description"),
tags: ["Privacy", "Utility", "Voice"],
authors: [Devs.D3SOX],
patches: [
// Block loading modules on Desktop
{
find: "Failed to load Krisp module",
replacement: {
match: /await \i.\i.ensureModule\("discord_krisp"\)/,
replace: "throw new Error();$&"
}
},
// Block loading modules on Web
{
find: "krisp_browser_models",
replacement: {
match: /(\i,\{\i:\(\)=>)\i/,
replace: "$1null"
}
},
// Set Krisp to not supported
{
find: "isNoiseCancellationSupported(){",
replacement: {
match: /isNoiseCancellationSupported\(\)\{/,
replace: "$&return false;"
}
}
],
});