Skip to content

Instantly share code, notes, and snippets.

@allquixotic
Last active August 17, 2018 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allquixotic/621078d12b261b4fa588e6b13b502cdc to your computer and use it in GitHub Desktop.
Save allquixotic/621078d12b261b4fa588e6b13b502cdc to your computer and use it in GitHub Desktop.
Hide collapsed and muted channel categories in Discord

First, mute and collapse every channel category you don't care about. You only have to do this once, even if you restart Discord.

Second, click on the "Raw" button next to the file in this Gist named "COPY-THIS.js" (it's right below this readme). Then, press Ctrl+A followed by Ctrl+C. The code is now on your clipboard. We'll use this later. You must do this every time you restart Discord.

Developer Tools Sequence

Step 1 below varies. The remaining steps are the same for Discord Web App and Discord Desktop.

DO ONLY ONE OF THESE vvvvvvv

Discord Web App

  1. In the Discord web app (in Firefox/Chrome/Edge): Press F12 or Ctrl+Shift+I. This should bring up a Developer Tools window.

The exact command to access Developer Tools may vary, so Google it if this doesn't bring up the developer tools window.

-OR-

Discord Desktop App

  1. Press Ctrl+Shift+I to bring up Developer Tools.

END OF 'DO ONLY ONE OF THESE' ^^^^^^^^

For Web App and Desktop alike:

  1. Click "Console" tab.
  2. Paste the code contents using Ctrl+V into the console prompt (the line at the bottom) and press enter. Ignore Discord's warning about this code being dangerous; it isn't.
  3. Now you can close the Developer console.
  4. After you scroll in the channel list, it may take up to 3 seconds for the extra categories to be removed.
  5. Repeat these steps if you restart your Discord desktop app or refresh/reload your Discord Web App.
function vaniche(){for(var e=document.evaluate("//div[contains(@class, 'container-') and div/div[contains(@class, 'wrapperMuted-')]]",document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),n=e.iterateNext(),t=new Array;n;)t.push(n),n=e.iterateNext();for(var a=t.length,i=0;i<a;i++)t[i].style.display="none";setTimeout(vaniche,3e3)}vaniche();
//THIS IS THE UN-MINIFIED CODE. IF YOU ARE JUST USING THE CODE, YOU DO NOT NEED THIS. JUST COPY THE COPY-THIS.JS ABOVE!
function vaniche() {
var ells = document.evaluate("//div[contains(@class, 'container-') and div/div[contains(@class, 'wrapperMuted-')]]", document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
var ell = ells.iterateNext();
var ella = new Array();
while(ell) {
ella.push(ell);
ell = ells.iterateNext();
}
var ellalen = ella.length;
for(var i = 0; i < ellalen; i++) {
ella[i].style.display = "none";
}
setTimeout(vaniche, 3000);
}
vaniche();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment