Skip to content

Instantly share code, notes, and snippets.

@lostdusty
Forked from MeguminSama/Discord Experiments.js
Created September 17, 2022 19:38
Show Gist options
  • Save lostdusty/83d31e7687938a4befbe0296aa95bbea to your computer and use it in GitHub Desktop.
Save lostdusty/83d31e7687938a4befbe0296aa95bbea to your computer and use it in GitHub Desktop.
Discord Experiments.js
let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.default?.isDeveloper !== "undefined")
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.default._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 = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser
@lostdusty
Copy link
Author

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