Skip to content

Instantly share code, notes, and snippets.

@MPThLee
Last active May 29, 2025 09:38
Show Gist options
  • Save MPThLee/3ccb554b9d882abc6313330e38e5dfaa to your computer and use it in GitHub Desktop.
Save MPThLee/3ccb554b9d882abc6313330e38e5dfaa to your computer and use it in GitHub Desktop.
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
* Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#comments
**/
// Older gist description: Enable Discord Developer Menus in any environment except mobile app without BetterDiscord using Console.
@acendvgnt
Copy link

Attempting to run this code today on my BD build, seems to stall without any error at first but does not seem to enable the Experiments tab. it does, however, spit this out:
image
No clue what's going on! help would be appreciated.

@Orchidthederg
The output is normal. I'm not sure why it wouldn't work on a BD client. Try opening the User Settings AFTER executing the code block and see if anything changes?

@Orchidthederg
Copy link

Oh, huh, it works fine now! Apologies!

@Etanarvazac
Copy link

  • changed e.c!=undefined to e.b!=undefined
webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { if(e.b!=undefined){module = Object.values(e.c).find(x => x?.exports?.default?.getUsers && x.exports.default._dispatcher._actionHandlers).exports.default;} }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

This worked! Thanks!

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