Monday, August 7, 2023

How to Hide Blocked Discord Messages

Are you annoyed by a steady stream of blocked message indicators?

First, be sure to exit Discord. We will be modifying the client.

Second, navigate to the Discord files on your computer at a location like the one below.

C:\Users\Jay\AppData\Local\Discord\app-1.0.9020\modules\discord_krisp-1\discord_krisp
Your USERNAME and DISCORD VERSION likely differ. The file you are looking for is index.js.

Third, we will add the code shown below in green to index.js.

const KrispModule = require('./discord_krisp.node');

console.info('Initializing krisp module');
KrispModule._initialize();

KrispModule.getNcModels = function () {
  return new Promise((resolve) => {
    KrispModule._getNcModels((models) => resolve(models));
  });
};

KrispModule.getVadModels = function () {
  return new Promise((resolve) => {
    KrispModule._getVadModels((models) => resolve(models));
  });
};

module.exports = KrispModule;

const sheet = window.document.styleSheets[0];
const style = `[class^='groupStart']:has([class^='blockedSystemMessage']) { overflow: hidden; height: 0; margin: 0; }`;
sheet.insertRule(style, sheet.cssRules.length);

Finally, do note these changes may need to be re-applied after an update to Discord.



Addendum: If you rely on the web version of Discord, try the Stylus extension for chromium-based browsers. In this latter case you would simply add the style as follows:

@-moz-document domain("discord.com") {
    [class^='groupStart']:has([class^='blockedSystemMessage']) { overflow: hidden; height: 0; margin: 0; }
}

No comments:

Post a Comment