Created
August 11, 2022 05:45
-
-
Save itslevir/b21f7cfe01e887d9f7e4b5bc83081097 to your computer and use it in GitHub Desktop.
Send a random ID through discord console in DM
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
const getToken = () => { | |
return (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken() | |
} | |
fetch(`https://canary.discord.com/api/v9/channels/${new URL(location.href).pathname.split("/")[3]}/messages`, { | |
headers: { | |
"Authorization": getToken(), | |
"Content-Type": "application/json" | |
}, | |
method: "POST", | |
body: JSON.stringify({ | |
content: [...Array(15)].map(i => Math.round((Date.now() + Math.random() * Date.now())).toString(36)).join(""), | |
nonce: Date().now, | |
tts: false | |
}) | |
}) | |
.then((res) => res.json()) | |
.then((data) => console.log(data)) | |
.catch((err) => console.log(err)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment