Paste everything below into your browser's F12 console.
-
The main script:
class Dishcord { #TOKEN = null; #PAYLOAD = null; #TURNS = 0; #DELAYS = [3.2, 3.3, 3.4, 3.5, 3.6, 3.7]; constructor(token, payload) { this.#TOKEN = token; this.#PAYLOAD = payload; } async start(turns) { if (turns < 1 || turns === undefined) { console.log("Turns can't be less than 1!"); return; } console.log("Started!"); this.#TURNS = turns; while (this.#TURNS > 0) { const delay = this.#getRandomDelayInMs(); this.#send(); console.log(`delay: ${delay}ms | ${this.#TURNS - 1} turns left`); await this.#sleep(delay); this.#TURNS--; } } stop() { this.#TURNS = 0; console.log("Stopped!"); } #send() { const formData = new FormData(); formData.append( "payload_json", this.#getPayloadWithUpdatedNonce(PAYLOAD) ); fetch(`https://discord.com/api/v9/interactions`, { method: "POST", headers: { Authorization: TOKEN, }, body: formData, }); } #getPayloadWithUpdatedNonce(payload) { const newNonce = this.#generateRandom18DigitNumber(); const jsonPayload = JSON.parse(payload); jsonPayload.nonce = newNonce; return JSON.stringify(jsonPayload); } #generateRandom18DigitNumber() { let randomNumber = ""; for (let i = 0; i < 19; i++) { randomNumber += Math.floor(Math.random() * 10); } return randomNumber; } #getRandomDelayInMs() { const randomIndex = Math.floor(Math.random() * this.#DELAYS.length); return this.#DELAYS[randomIndex] * 1000; } #sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } }
-
Credentials:
- Token:
You can find your token value in Discord's Local Storage.
const TOKEN = YOUR_TOKEN_VALUE;
- Payload:
To get the payload text: Open the F12 Network tab, go to the Discord channel where you want to automate the command, run the command manually once, find the
interactions
request in the Network tab, switch to the Payload sub-tab, and copy the text value from{
to}
(including the brackets).const PAYLOAD = `THE_PAYLOAD_TEXT`;
- Token:
-
Getting ready:
const dc = new Dishcord(TOKEN, PAYLOAD);
-
Getting started:
- To start:
dc.start(10);
This will send the command 10 times. You can change the number to any number you want.
- To stop:
dc.stop();
- To start: