Equicord/src/equicordplugins/blockKrisp/index.ts

41 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-06-01 14:32:22 -04:00
/*
* 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: "BlockKrisp",
description: "Prevent Krisp from loading",
authors: [Devs.D3SOX],
patches: [
// Block loading modules on Desktop
{
find: "Failed to load Krisp module",
replacement: {
2024-06-19 12:44:47 -04:00
match: /await \i.\i.ensureModule\("discord_krisp"\)/,
2024-06-01 14:32:22 -04:00
replace: "throw new Error();$&"
}
},
// Block loading modules on Web
{
find: "krisp_browser_models",
replacement: {
2024-06-19 12:44:47 -04:00
match: /\i:function\(\)\{/,
2024-06-01 14:32:22 -04:00
replace: "$&return null;"
}
},
// Set Krisp to not supported
{
2024-09-09 23:01:38 -04:00
find: "isNoiseCancellationSupported(){",
2024-06-01 14:32:22 -04:00
replacement: {
match: /isNoiseCancellationSupported\(\)\{/,
replace: "$&return false;"
}
}
],
});