Skip to content

Instantly share code, notes, and snippets.

@NullDev
Last active October 14, 2025 14:07
Show Gist options
  • Select an option

  • Save NullDev/cac59e13967aecf0360cf35f88ce8932 to your computer and use it in GitHub Desktop.

Select an option

Save NullDev/cac59e13967aecf0360cf35f88ce8932 to your computer and use it in GitHub Desktop.
Some Discord console tricks

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:

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

(() => {
const uploaded_filename = "<UPLOAD_FILENAME_HERE>";
const channel_id = "<CHANNEL_ID_HERE>";
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 <UPLOAD_FILENAME_HERE> with value above
  • replace <CHANNEL_ID_HERE> with the channel id you want to send the message in

Generate friend link

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

Change HypeSquad House

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
@R2kip
Copy link

R2kip commented Feb 28, 2024

VM1043:3 Uncaught TypeError: Cannot convert undefined or null to object
at Function.values ()
at :3:81
at t (sentry.0806da5664eb9fbf3615.js:1:6757)
at new SnippetApi (:3:47)
at :225:21

ptb 269561 (2b2b368) Host 1.0.1057 x64 (44185) Windows 10 64-bit (10.0.19045)

@wavedevgit
Copy link

just update this shit bro 🔥

@kingdudely
Copy link

This is better

const getModules = () => webpackChunkdiscord_app.push([[Symbol()], {}, m => m])?.c ?? {}
const findModule = find => Object.values(getModules()).map(x => x?.exports?.default ?? x?.exports).filter(Boolean).find(find)

Example

// Get token
findModule(m => typeof m?.getToken === "function")?.getToken()

@NullDev
Copy link
Author

NullDev commented Jun 17, 2025

@wavedevgit Updated experiments code!
@kingdudely Added! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment