Skip to content

Instantly share code, notes, and snippets.

@dvingerh
Last active July 14, 2018 22:55
Show Gist options
  • Save dvingerh/2124f3e7466564c9725dc378872056c3 to your computer and use it in GitHub Desktop.
Save dvingerh/2124f3e7466564c9725dc378872056c3 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Discord Hide Guilds
// @description AAaa
// @namespace Violentmonkey Scripts
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @match *://discordapp.com/*
//
// ==/UserScript==
$(document).ready(function() {
$('.guild-separator').after($('<button style="background-color: #2f3136; box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.1); border-radius: 25px; padding: 0px; width: 50px; height: 50px; font-size: 13px; color: #fff; font-weight: normal; text-align: center; margin-bottom: 10px;" type="button" id="toggleGuilds">Toggle</button>'));
var hidden = true;
$("#toggleGuilds").click(function() {
if (!hidden) {
hidden = true;
} else {
hidden = false;
}});
checkGuildSettings();
function checkGuildSettings() {
$("div.guild-inner").each(function(){
var channel_url = $(this).find('a').attr('href');
var guild_arr = [
"210989405286957059",
];
console.log(channel_url + " - " + guild_arr.indexOf(channel_url));
if (guild_arr.indexOf(channel_url.split("/").reverse()[1]) == -1 && channel_url.indexOf("@me") == -1 && hidden == true) {
$(this).parent().css("display", "none");
}
else {
$(this).parent().css("display", "flex");
}
});
x = setTimeout(function() {
checkGuildSettings();
}, 250);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment