# Discord Console Tricks (Experiments, Dev Stuff, etc) ## INSTRUCTIONS FOR ALL OF THEM: > - Open DevTools in Discord with `CTRL + SHIFT + i` (ONLY POSSIBLE IN CANARY AND PBT ANYMORE) > - Paste Snippet > - Edit it. (optional: if instructed) > - Hit Enter. ## Enable Experiments and Dev-Only Options: ```js let wpRequire; window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]); mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined"); usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers) nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes) try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}}) } catch (e) {} oldGetUser = usermod.exports.default.__proto__.getCurrentUser; usermod.exports.default.__proto__.getCurrentUser = () => ({isStaff: () => true}) nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]() usermod.exports.default.__proto__.getCurrentUser = oldGetUser ``` ## Send Audio file as Voice Message ```js (() => { const uploaded_filename = ""; const channel_id = ""; const c = webpackChunkdiscord_app.push([[Symbol()], {}, ({c}) => Object.values(c)]); const a = c.find((x) => x?.exports?.Z?.getAPIBaseURL).exports.Z; webpackChunkdiscord_app.pop(); a.post({url: "/channels/" + channel_id + "/messages", body: {"flags": 1 << 13, "attachments": [{"id": "0", "filename": "file.ogg", "uploaded_filename": uploaded_filename, "waveform": "=", "duration_secs": 1}]} })})() ``` **Usage:** - open dev tools, go to network tab - send an audio file in any channel, watch for request to "/channels//attachments" - click on the request, go to the response tab and copy the value of the "upload_filename" property - replace with value above - replace with the channel id you want to send the message in ## Generate friend link ```js await (webpackChunkdiscord_app.push([[''],{},e=>m=Object.values(e.c)]),m) .find(m => m.exports?.Z?.createFriendInvite).exports.Z.createFriendInvite() ``` Use the code from the output and put `https://discord.gg/` in front of it. e.g.: `https://discord.gg/abcxyz`
**Note**: If you generate a new link, the old one will be invalidated! ## Change HypeSquad House ```js house = 1; (webpackChunkdiscord_app.push([[""],{},e=>{m=[];for(let r in e.c)m.push(e.c[r])}]),m) .find((e=>e?.exports?.Z?.joinHypeSquadOnline)).exports.Z.joinHypeSquadOnline({houseID: "HOUSE_" + house}) ``` CHange the house variable: - 1 = Bravery - 2 = Brilliance - 3 = Balance