Skip to content

Commit

Permalink
feat(blockKrisp): add patches and make available for web
Browse files Browse the repository at this point in the history
  • Loading branch information
D3SOX committed Jun 1, 2024
1 parent 2005838 commit 7de07c0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the plugin folders for screenshots
🎡 [**BetterActivities**](./betterActivities)
Shows activity icons in the member list and allows showing all activities

🔇 [**BlockKrisp**](./blockKrisp.discordDesktop)
🔇 [**BlockKrisp**](./blockKrisp)
Prevent Krisp from loading

🤝 [**FollowUser**](./followUser)
Expand Down
23 changes: 0 additions & 23 deletions blockKrisp.discordDesktop/index.ts

This file was deleted.

File renamed without changes.
40 changes: 40 additions & 0 deletions blockKrisp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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: {
match: /await (\i).default.ensureModule\("discord_krisp"\)/,
replace: "throw new Error();$&"
}
},
// Block loading modules on Web
{
find: "krisp_browser_models",
replacement: {
match: /getKrispSDK:function\(\)\{/,
replace: "$&return null;"
}
},
// Set Krisp to not supported
{
find: "\"shouldSkipMuteUnmuteSound\"",
replacement: {
match: /isNoiseCancellationSupported\(\)\{/,
replace: "$&return false;"
}
}
],
});
File renamed without changes
4 changes: 1 addition & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Plugins from "~plugins";

const PLUGINS = [
require("./betterActivities").default,
require("./blockKrisp").default,
require("./d3soxUpdater").default,
require("./followUser").default,
require("./ignoreTerms").default,
Expand All @@ -25,9 +26,6 @@ const PLUGINS = [
require("./voiceChatUtilities").default,
];

if (IS_DISCORD_DESKTOP) {
PLUGINS.push(require("./blockKrisp.discordDesktop").default);
}

for(const plugin of PLUGINS) {
(plugin.tags ??= []).push("D3SOX");
Expand Down

0 comments on commit 7de07c0

Please sign in to comment.