Skip to content

Instantly share code, notes, and snippets.

@jjason685
Last active September 24, 2021 10:47
Show Gist options
  • Save jjason685/6b003d33247a9d6b5c3bdf84393053e4 to your computer and use it in GitHub Desktop.
Save jjason685/6b003d33247a9d6b5c3bdf84393053e4 to your computer and use it in GitHub Desktop.
discord mass group leaver
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;
}
@Jahmary12
Copy link

how to use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment