Skip to content

Instantly share code, notes, and snippets.

@0x4007
Created October 5, 2022 11:39
Show Gist options
  • Save 0x4007/f153711e26da4d585d18d578424f4c1b to your computer and use it in GitHub Desktop.
Save 0x4007/f153711e26da4d585d18d578424f4c1b to your computer and use it in GitHub Desktop.
Made some tools to help mass delete Discord servers off of my account
(function scrapeServers() {
const servers = document.querySelectorAll(`[data-list-item-id^="guildsnav___"]`);
// console.log(servers);
const database = {};
servers.forEach(server => {
const guildsnav = server.getAttribute(`data-list-item-id`);
const serverId = guildsnav.match(/\d+$/igm)?.pop();
if (!serverId) { return }
database[serverId] = (server.getAttribute(`aria-label`).split(",").pop().trim())
})
console.log(database);
})();
(function DELETE() {
// const SERVERS = ["971115390027563090", "898337382296858697", "789823126966894612", "900935684225900584", "81384788765712384", "960281738465132624", "991704208057307278", "563037431604183070", "823813159592001537", "925970052174462976", "767303397522669569", "918178320682733648", "940204806029598730", "473781666251538452", "853432452181262346", "705799923014041651", "837010835423494144", "816133093357912124", "906961418111307796", "928937600226582528", "955008637812748309", "851375133988749343", "875485804120637480", "847178511604252741", "808906099172442122", "580251038083317760", "924442927399313448", "882867268021800991", "841573134531821608", "912998718645616680", "403741830812008449", "810916927919620096", "733646962045222912", "916004376290672681", "907309905717911562", "802775945701228555", "732921100702318723", "404673842007506945", "502416149343109121", "882367467022868570", "910898069338476585", "775859454780244028", "833074824447655976", "511504443653750785", "872472403970768916", "813494644066877460", "717806071858724987", "852059906038038528", "742384562646286509", "732694242639741055", "884325561504243722", "551050633898360852", "830137135540994062", "790157548845924352", "763219451905704026", "464241079042965516", "750784472697405646", "787417509136957450"]
const SERVERS = ["473781666251538452", "403741830812008449", "802775945701228555", "775859454780244028", "833074824447655976", "742384562646286509", "551050633898360852", "698935373568540753", "790157548845924352", "876983060409745418", "834499078434979890", "845400066532704256", "344842193019863040", "866742421303590922", "806256201762340874", "339694740201275392", "718590743446290492", "724167684455006208", "644739124741406738", "872879240255782912", "417796904760639509", "816046176192168008", "334689041674928128", "586187583634014208", "740287152843128944", "597638925346930701", "748031363935895552", "747274693274238987", "568763168441106433", "752342816033603624", "435685690936786944", "571015837163454489", "607175908750786560", "734804446353031319", "750408878008827925", "602826299974877205", "554623348622098432", "562828676480237578"]
for (const SERVER_ID of SERVERS) fetch(`https://discord.com/api/v9/users/@me/guilds/${SERVER_ID}`, {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.6",
"authorization": "NjkwMDU0MjIwOTIxMDQ1MDI0.GpiMWs.yLhfrVZLuaOw5j6c-Ev6P-80_l3KCIwqdZ_rYg",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"sec-gpc": "1",
"x-debug-options": "bugReporterEnabled",
"x-discord-locale": "en-US",
"x-super-properties": "eyJvcyI6Ik1hYyBPUyBYIiwiYnJvd3NlciI6IkNocm9tZSIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbGUiOiJlbi1VUyIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChNYWNpbnRvc2g7IEludGVsIE1hYyBPUyBYIDEwXzE1XzcpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS8xMDYuMC4wLjAgU2FmYXJpLzUzNy4zNiIsImJyb3dzZXJfdmVyc2lvbiI6IjEwNi4wLjAuMCIsIm9zX3ZlcnNpb24iOiIxMC4xNS43IiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIiwicmVmZXJyZXJfY3VycmVudCI6Imh0dHBzOi8vZ2l0aHViLmNvbS8iLCJyZWZlcnJpbmdfZG9tYWluX2N1cnJlbnQiOiJnaXRodWIuY29tIiwicmVsZWFzZV9jaGFubmVsIjoic3RhYmxlIiwiY2xpZW50X2J1aWxkX251bWJlciI6MTUwNzQ4LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==",
"cookie": "__dcfduid=f486cf80eb4111ecb99015cbe3b9cce7; __sdcfduid=f486cf81eb4111ecb99015cbe3b9cce7a60d4ea5865cd848d1c9b831e525ec8635618806efa7b2fe6696fbe2002708b1; __cfruid=701af0c578f01998b392ffab326e7e4b35593064-1664966326; __cf_bm=WOg2x28XysLbxyKG1DrwvuaktFjMdwFdn4S.P6koadk-1664968280-0-Abjh3iw8s/Q/RUrMF+Q8H5EZnZ8DioNPU9HFGEj1a+hO5AoOrotXzv7BGde7EzssUsHx+6JA8+lBPJlid8LCTVde3nF/YJrQWcvhrkiD04RR272UWUsqU1bQ+E3DHCbUsA==; locale=en-US; OptanonConsent=isIABGlobal=false&datestamp=Wed+Oct+05+2022+19%3A11%3A46+GMT%2B0800+(Taipei+Standard+Time)&version=6.33.0&hosts=&landingPath=NotLandingPage&groups=C0001%3A1%2CC0002%3A1%2CC0003%3A1&AwaitingReconsent=false",
"Referer": "https://discord.com/channels/967319632530767924/967414105403174912",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"body": "{\"lurking\":false}",
"method": "DELETE"
});
})()
@0x4007
Copy link
Author

0x4007 commented Oct 5, 2022

lol Discord instantly logged me out and made me change my password due to my auth key

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