-
Star
(251)
You must be signed in to star a gist -
Fork
(23)
You must be signed in to fork a gist
-
-
Save MPThLee/3ccb554b9d882abc6313330e38e5dfaa to your computer and use it in GitHub Desktop.
/** | |
* !!!! 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. |
Doesn't work anymore as of today.
Can confirm, just broke for me as well. Tried feeding the code and the error to Claude, but after many different tries, got basically nowhere. Was worth a shot, but it looks like someone more familiar with Discord internals will need to fix this one.
- changed
e.c!=undefined
toe.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;
Oh fire, thanks!
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:
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?
Oh, huh, it works fine now! Apologies!
- changed
e.c!=undefined
toe.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!
e.c!=undefined
toe.b!=undefined