-
-
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. |
this should work (simply changed hasFlag to isStaff)
@acendvgnt yup you are right, simply changing hasFlag
to isStaff
makes the plugin work again. Thank you!
Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(
Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(
@PierreLGBT maybe if you ask in English
Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(@PierreLGBT maybe if you ask in English
i dont speak french but i speak spanish i think they want code to make this a bd plugin
can anyone make that into a betterdc plugin
Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(@PierreLGBT maybe if you ask in English
i dont speak french but i speak spanish i think they want code to make this a bd plugin
@catb0x yes you are correct :)
discord is messing around with user state modifications (impersonation). this should work for build 168435 and up
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__.getNonImpersonatedCurrentUser; usermod.exports.default.__proto__.getNonImpersonatedCurrentUser= () => ({isStaff: () => true}) nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]() usermod.exports.default.__proto__.getNonImpersonatedCurrentUser= oldGetUser
It seems like it stopped working as of the newest update.
It seems like it stopped working as of the newest update.
yea i just deleted it XD
YOO NO IT STILL WORKS FOR ME LOL IT SEEMS TO BE UNPATCHED SO YALL SHOULD STILL USE IT!!!
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
this should work in all cases
webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).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 btw the script I sent is old and it worked for me because I wasn't on the latest, acendvgnt posted a new one but I don't want to risk losing discord experiments to test it so yeah gl guys
Works.
is there a way to make it so you dont have to run it each time you start discord
is there a way to make it so you dont have to run it each time you start discord
not really but you can automate the process on the web version of Discord by using Tampermonkey or some other userscript extension
Here is a BetterDiscord plugin for it:
/**
* @name Experiments
* @author Maple38
* @description Enables access to experiments and staff-only options for normal users.
* @version 1.0.0
*/
let wpRequire
module.exports = class Experiments {
load() {}
start = () => {
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
let mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
let usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
let 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) {}
let 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
}
stop = () => {}
}
Put that into a BetterDiscord plugin and it should work. I simply turned the already working code to do it into a plugin that runs when you run Discord. I do not know any Javascript, so I probably won't be able to fix any issues you may have with it. Despite not knowing any Javascript, I somehow got this to work with the power of imagination and spending an hour assaulting my keyboard to fix errors.
If you don't know how to turn it into a plugin, just download this and put it in your plugins folder, which you can find by pressing Windows + R
and typing %APPDATA%\BetterDiscord\plugins
.
this should work in all cases
webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).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;
works, thanks.
this should work in all cases
webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).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;
I can confirm this works on stable at the date of 14/02/2023
is it dangerous to use experiments on my main?
is it dangerous to use experiments on my main?
If you have any doubts, then you better don't do any of it, since its clearly against the T&C of Discord if you do so. There are people claiming Discord "knows everything" but it's likely only Discord's internal staff will know the exact answer (or someone who decided to investigate it).
this should work in all cases
webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).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;
Also vouch for the code, working as expected for now
is it dangerous to use experiments on my main?
Nope. If you read the code, there’s nothing that it can do to steal your account. Also it’s not against tos
Pretty sure it’s entirely not against tos.
is it dangerous to use experiments on my main?
Absolutely. We can't say for sure that using them is safe, after all you have to enter this code to be able to use it in the first place unless you are discord staff. So it's best to assume yes.
I would say that while there is an inherent risk, you should be fine just having them enabled, because lots of people do without being banned. The main area I could see issues arising is if you attempt to bypass server-side permissions, like bigger file uploads without nitro. Changing stuff on the client-side shouldn't cause much issue though.
I cant open up console anymore my config looks like
{ "BACKGROUND_COLOR": "#ffffff", "IS_MAXIMIZED": true, "IS_MINIMIZED": false, "WINDOW_BOUNDS": { "x": 46, "y": 143, "width": 1441, "height": 791 }, "openasar": { "setup": true, "cmdPreset": "perf", "quickstart": true, "multiInstance": false }, "trayBalloonShown": true, "OPEN_ON_STARTUP": false, "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true }
Pretty sure it’s entirely not against tos.
Software in Discord’s services
License to our software. Some of our services allow you to download client software. So long as you comply with these terms, we grant you a worldwide, non-exclusive, personal, and non-assignable license to download, install, and run that software, solely to access our services.
You may not copy, modify, create derivative works based upon, distribute, sell, lease, or sublicense any of our software or services. You also may not reverse engineer or decompile our software or services, attempt to do so, or assist anyone in doing so, unless you have our written consent or applicable law permits it.
Unless my understand of "modify" is incorrect, it writes "you may not modify any of our software or services".
I cant open up console anymore my config looks like
{ "BACKGROUND_COLOR": "#ffffff", "IS_MAXIMIZED": true, "IS_MINIMIZED": false, "WINDOW_BOUNDS": { "x": 46, "y": 143, "width": 1441, "height": 791 }, "openasar": { "setup": true, "cmdPreset": "perf", "quickstart": true, "multiInstance": false }, "trayBalloonShown": true, "OPEN_ON_STARTUP": false, "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true }
Have you tried to maybe restart your Discord? Or maybe try to reinstall it?
this should work in all cases
webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).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;
Thanks, working fine on Canary
Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?
Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?
This code only enables the Experiments tab and the ability to enable experiments in it. If an experiment doesn't work, it's most likely because Discord is experimenting with it.
Here is a BetterDiscord plugin for it:
/** * @name Experiments * @author Maple38 * @description Enables access to experiments and staff-only options for normal users. * @version 1.0.0 */ let wpRequire module.exports = class Experiments { load() {} start = () => { window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]); let mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined"); let usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers) let 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) {} let 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 } stop = () => {} }
Put that into a BetterDiscord plugin and it should work. I simply turned the already working code to do it into a plugin that runs when you run Discord. I do not know any Javascript, so I probably won't be able to fix any issues you may have with it. Despite not knowing any Javascript, I somehow got this to work with the power of imagination and spending an hour assaulting my keyboard to fix errors.
If you don't know how to turn it into a plugin, just download this and put it in your plugins folder, which you can find by pressing
Windows + R
and typing%APPDATA%\BetterDiscord\plugins
.
Thank you so much! Can you please upload this to a GitHub repo or something easier for other people to find?
Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?
It works, its just that the tonemapping isn't great. Its definitely better than standard.
Now I just need a way to make it stick through restarts of discord
this should work (simply changed hasFlag to isStaff)