Skip to content

Instantly share code, notes, and snippets.

@itslevir
Created August 11, 2022 05:45
Show Gist options
  • Save itslevir/b21f7cfe01e887d9f7e4b5bc83081097 to your computer and use it in GitHub Desktop.
Save itslevir/b21f7cfe01e887d9f7e4b5bc83081097 to your computer and use it in GitHub Desktop.
Send a random ID through discord console in DM
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