Last active
September 24, 2021 10:47
-
-
Save jjason685/6b003d33247a9d6b5c3bdf84393053e4 to your computer and use it in GitHub Desktop.
discord mass group leaver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('[aria-label]').click(); | |
var groupLeaver = setInterval(function() { | |
openGroupModal(); | |
setTimeout(leaveGroup, 100); | |
}, 200); | |
function openGroupModal() { | |
let channel = findGroup(); | |
if (!channel) clearTimeout(groupLeaver); | |
else { | |
channel.querySelector('[class*="closeButton"]').click(); | |
} | |
} | |
function leaveGroup() { | |
var aTags = document.getElementsByTagName("div"); | |
var searchText = "Leave Group"; | |
var found; | |
for (var i = 0; i < aTags.length; i++) { | |
if (aTags[i].textContent == searchText) { | |
found = aTags[i]; | |
break; | |
} | |
} | |
found.click(); | |
} | |
function findGroup() { | |
for (let element of document.querySelectorAll('[class*="subtext"]')) { | |
if (element.innerText.includes('Members')) { | |
return element.parentElement.parentElement.parentElement.parentElement; | |
} | |
} | |
return undefined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to use it