Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Discord Experiments.js
webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=Object.values(r.c)]);
var UserStore = cache.find(m => m?.exports?.default?.getCurrentUser).exports.default;
var actions = UserStore._dispatcher._actionHandlers._orderedActionHandlers["CONNECTION_OPEN"];
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
@DeltaNachos
Copy link

DeltaNachos commented Oct 18, 2022

works :)

@Suni29
Copy link

Suni29 commented Oct 21, 2022

Its weird because the code that is shared by @MeguminSama isn't working every time.
I had it working for like 2 weeks and then it stopped working for a day or two.
I have this backup one which was working every time for me so I though I share it.

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 = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

@EvaxTheFox
Copy link

EvaxTheFox commented Nov 17, 2022

Its weird because the code that is shared by @MeguminSama isn't working every time.
I had it working for like 2 weeks and then it stopped working for a day or two.
I have this backup one which was working every time for me so I though I share it.

Yours doesnt work, the original one does.

@Suni29
Copy link

Suni29 commented Nov 19, 2022

Its weird because the code that is shared by @MeguminSama isn't working every time.
I had it working for like 2 weeks and then it stopped working for a day or two.
I have this backup one which was working every time for me so I though I share it.

Yours doesnt work, the original one does.

Weird, sometimes one of them doesn't work, sometimes works with both.
And there was users that reported that the original one doesn't work, but mine is, or the complete opposite.
I don't really know why is that but just use the one that works.

@EvaxTheFox
Copy link

EvaxTheFox commented Nov 22, 2022

Its weird because the code that is shared by @MeguminSama isn't working every time.
I had it working for like 2 weeks and then it stopped working for a day or two.
I have this backup one which was working every time for me so I though I share it.

Yours doesnt work, the original one does.

Weird, sometimes one of them doesn't work, sometimes works with both. And there was users that reported that the original one doesn't work, but mine is, or the complete opposite. I don't really know why is that but just use the one that works.

shrug

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