Message

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

/*DiscordFriendInvites 1.0.

0 by woodendoors7 */ var
outputCreate,selectInvite,token,div,closeBtn,offsetLeft,offsetTop,html='\n <div
id="mainWindow">\n <div id="header">DiscordFriendInvites<br>by
woodendoors7<div id="closeBtn" class="closeButton-30b1gR" aria-label="Dismiss"
role="button" tabindex="0"><svg aria-hidden="true" role="img" class="closeIcon-
3eoP1e" width="18" height="18" viewBox="0 0 24 24"><path fill="currentColor"
d="M18.4 4L12 10.4L5.6 4L4 5.6L10.4 12L4 18.4L5.6 20L12 13.6L18.4 20L20 18.4L13.6
12L20 5.6L18.4 4Z"></path></svg></div></div>\n <div class="dividing">\n
<p class="sectionTitle">\n Create Invite\n </p>\n
<button class="fieldButton-14lHvK button-ejjZWC lookFilled-1H2Jvj colorPrimary-2-
Lusz sizeSmall-3R2P2p grow-2T4nbg" id="runCreate">Do It</button>\n </div>\n
\n <div class="dividing">\n <p class="sectionTitle">\n
View Invite\n </p>\n <select name="Select Invite"
id="selectInvite">\n \n </select>\n \n <button
class="sectionButton fieldButton-14lHvK button-ejjZWC lookFilled-1H2Jvj
colorPrimary-2-Lusz sizeSmall-3R2P2p grow-2T4nbg" id="runInfo">View Info</button>\n
</div>\n <div onClick="this.select();" disabled type="text"
class="textOutput inputDefault-Ciwd-S input-3O04eu" id="outputCreate"><b
style="margin-top: 8px;display: block;">Welcome!</b></div>\n <button
style="margin-left: 32%; margin-top: 10px;" class="sectionButton fieldButton-14lHvK
button-ejjZWC lookFilled-1H2Jvj colorPrimary-2-Lusz sizeSmall-3R2P2p grow-2T4nbg"
id="runDelete">Delete All Invites</button>\n <a
href="https://github.com/woodendoors7/DiscordFriendInvites"><img style="margin-top:
10px; width: 250px;"
src="https://cdn.discordapp.com/attachments/1113574795540430969/1113574807611650128
/pleasestar.png"></a>\n </div>',css='#mainWindow {\n position:
absolute;\n z-index: 9;\n background-color: #2F3136;\n
border: 1px solid #3f4147;\n color: white;\n text-align: center;\n
height: 280px;\n width: 400px;\n font-family: "Century Gothic",
CenturyGothic, Geneva, AppleGothic, sans-serif;\n z-index: 1000;\n
border-radius: 12px;\n }\n \n #header {\n padding: 10px;\n
cursor: move;\n z-index: 10;\n background-color: #5865F2;\n
color: #ffe8e9;\n user-select: none;\n font-weight: bold;\n
border-top-left-radius:12px;\n border-top-right-radius: 12px;\n\n }\
n \n .dividing {\n background-color: #2F3136;\n width: 100%;\n
height: 50px;\n text-align: left;\n vertical-align: middle;\n
white-space: nowrap;\n line-height: 50px;\n }\n \n .sectionTitle {\
n vertical-align: middle;\n margin: 0px;\n font-size: 18px;\n
margin-left: 15px;\n }\n \n .sectionButton {\n vertical-align:
middle;\n }\n \n .dividing * {\n display: inline;\n }\n \n
.textOutput {\n max-width: 93%;\n min-height: 16px;\n cursor:
text;\n margin-left: 10px;\n user-select: all;\n padding:
3px;\n text-align: center;\n margin-left: 10px;\n }';async
function inject(){var
e=document.createElement("div");e.innerHTML=html,e.innerHTML+=`\n\n<style>${css}</
style>`,document.body.appendChild(e),
(div=document.getElementById("mainWindow")).style.top="100px",div.style.left="100px
",window.addEventListener("mousemove",divMove,!
0),document.getElementById("header").addEventListener("mousedown",mouseDown,!
1),window.addEventListener("mouseup",mouseUp,!
1),document.getElementById("runCreate").addEventListener("click",createElement),doc
ument.getElementById("runInfo").addEventListener("click",checkTheInfo),document.get
ElementById("runDelete").addEventListener("click",deleteInvites),closeBtn=document.
getElementById("closeBtn"),outputCreate=document.getElementById("outputCreate"),sel
ectInvite=document.getElementById("selectInvite"),expireAfterCreate=document.getEle
mentById("expireAfterCreate"),maxUsesCreate=document.getElementById("maxUsesCreate"
),closeBtn.addEventListener("click",uninject),token=await
getToken(),outputCreate.innerHTML='<b style="margin-top: 8px;display:
block;">Welcome!</b>',fetchInvites(!1)}async function createElement()
{outputCreate.innerHTML='<b style="margin-top: 8px;display:
block;">Loading . . .</b>';let e=await
fetch("https://discord.com/api/v9/users/@me/invites",
{credentials:"include",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0;
rv:103.0) Gecko/20100101 Firefox/103.0",Accept:"*/*","Accept-
Language":"en,sk;q=0.8,cs;q=0.5,en-US;q=0.3","Content-Type":"application/
json",Authorization:token,"X-Discord-Locale":"en-US","X-Debug-
Options":"bugReporterEnabled","Sec-Fetch-Dest":"empty","Sec-Fetch-
Mode":"cors","Sec-Fetch-Site":"same-origin","Sec-GPC":"1"},referrer:"https://
discord.com/channels/@me",body:"{}",method:"POST",mode:"cors"}),t=await
e.json();outputCreate.innerHTML=`<b style="margin-top: 8px;display:
block;">https://discord.gg/${t.code}</b>`,"No
Invites"==selectInvite.firstChild.innerText&&(selectInvite.innerHTML="");let
n=document.createElement("option");n.value=t.code,n.innerText=`discord.gg/$
{t.code}`,selectInvite.appendChild(n)}async function fetchInvites(e){let t=await
fetch("https://discord.com/api/v9/users/@me/invites",
{credentials:"include",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0;
rv:103.0) Gecko/20100101 Firefox/103.0",Accept:"*/*","Accept-
Language":"en,sk;q=0.8,cs;q=0.5,en-US;q=0.3","Content-Type":"application/
json",Authorization:token,"X-Discord-Locale":"en-US","X-Debug-
Options":"bugReporterEnabled","Sec-Fetch-Dest":"empty","Sec-Fetch-
Mode":"cors","Sec-Fetch-Site":"same-origin","Sec-GPC":"1"},referrer:"https://
discord.com/channels/@me",method:"GET",mode:"cors"}),n=await
t.json();if(selectInvite.innerHTML="",0==n.length){let
e=document.createElement("option");return e.value="none",e.innerText="No
Invites",selectInvite.appendChild(e),n}for(let e=0;e<n.length;e++){let
t=document.createElement("option");t.value=n[e].code,t.innerText=`discord.gg/$
{n[e].code}`,selectInvite.appendChild(t)}if(1==e)return n}async function
checkTheInfo(){let e=selectInvite.value;outputCreate.innerHTML='<b style="margin-
top: 8px;display: block;">Loading . . .</b>';let t,n=await fetchInvites(!0);for(let
i=0;i<n.length;i++)n[i].code==e&&(t=n[i]);outputCreate.innerHTML=t?`<b>Uses:</b> $
{t.uses}/${t.max_uses}, <b>Expires in:</b> ${Math.round(t.max_age/60/60)}
hours,</br> <i>https://discord.gg/${t.code}</i>`:"Invite not found!"}async function
deleteInvites(){await fetch("https://discord.com/api/v9/users/@me/invites",
{credentials:"include",headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0;
rv:103.0) Gecko/20100101 Firefox/103.0",Accept:"*/*","Accept-
Language":"en,sk;q=0.8,cs;q=0.5,en-US;q=0.3","Content-Type":"application/
json",Authorization:token,"X-Discord-Locale":"en-US","X-Debug-
Options":"bugReporterEnabled","Sec-Fetch-Dest":"empty","Sec-Fetch-
Mode":"cors","Sec-Fetch-Site":"same-origin","Sec-GPC":"1"},referrer:"https://
discord.com/channels/
@me",method:"DELETE",mode:"cors"});selectInvite.innerHTML="";let
e=document.createElement("option");e.value="none",e.innerText="No
Invites",selectInvite.appendChild(e),outputCreate.innerHTML='<b style="margin-top:
8px;display: block;">Invites
deleted</b>'}"complete"===document.readyState&&inject();var clicked=!1;async
function mouseUp(){clicked=!1}async function mouseDown(e){clicked=!
0,offsetLeft=div.offsetLeft-e.clientX,offsetTop=div.offsetTop-e.clientY}function
divMove(e)
{clicked&&(div.style.position="absolute",div.style.top=e.clientY+offsetTop+"px",div
.style.left=e.clientX+offsetLeft+"px")}async function getToken(){return
outputCreate.innerHTML='<b style="margin-top: 8px;display: block;">Getting
token...</b>',await(webpackChunkdiscord_app.push([[""],{},e=>{m=[];for(let t in
e.c)m.push(e.c[t])}]),m).find((e=>void 0!
==e?.exports?.default?.getToken)).exports.default.getToken()}async function
uninject()
{window.removeEventListener("mousemove"),document.getElementById("header").removeEv
entListener("mousedown"),window.removeEventListener("mouseup"),document.getElementB
yId("mainWindow").remove(),inject=null,createElement=null,inject=null,fetchInvites=
null,checkTheInfo=null,deleteInvites=null,removeEventListener("mouseMove",window)}c
onsole.log("Hello!");

You might also like