The following code sends a patch request to discord which disables the new UI, this must be done via the the web/desktop client
it is reccomended to use the discord web app: https://discord.com/app
To run the script, you must:
- Go to the discord web/desktop client
- Log into your account
- Press
Ctrl+Shift+I
orF12
and the Developer Tools window should appear - Click the console tab at the top
- Then paste the following code into the developer console:
// get the client data from the webpack chunk
let clientData = (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m);
// get the theme from the client data
let themeData = clientData.find(m=>m?.exports?.default?.gradientPreset!==void 0)?.exports?.default?.gradientPreset.id || clientData.find(m=>m?.exports?.default?.theme!==void 0).exports.default.theme;
// define list of nitro themes to prevent themes from resetting to default dark/light
let gradientThemes={'0':'agoIAhABGgISACAB','1':'agwIAhABGgQSAggBIAE=','2':'agwIAhABGgQSAggCIAE=','3':'agwIAhABGgQSAggDIAE=','4':'agwIAhABGgQSAggEIAE=','5':'agwIAhABGgQSAggFIAE=','6':'agwIAhABGgQSAggGIAE=','7':'agwIAhABGgQSAggHIAE=','8':'agwIARABGgQSAggIIAE=','9':'agwIARABGgQSAggJIAE=','10':'agwIARABGgQSAggKIAE=','11':'agwIARABGgQSAggLIAE=','12':'agwIARABGgQSAggMIAE=','13':'agwIARABGgQSAggNIAE=','14':'agwIARABGgQSAggOIAE=','15':'agwIARABGgQSAggPIAE=','17':'agwIARABGgQSAggRIAE=','18':'agwIARABGgQSAggSIAE=','19':'agwIARABGgQSAggTIAE=','20':'agwIARABGgQSAggUIAE=','21':'agwIARABGgQSAggVIAE='};
// get the user's token from the client data
let token = clientData.find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken();
// select the encoded string based on the theme
// if user is using default light/dark theme, set the encoded string to the default light/dark theme
let encodedString = typeof themeData === 'string' ?
themeData == 'light' ? 'agYIAhABIAE=' : 'agYIARABIAE='
// else user is using a nitro theme, set the encoded string to the nitro theme
: gradientThemes[themeData];
// send a request to discord settings to update a value
fetch("https://discord.com/api/v9/users/@me/settings-proto/1", {
method: "PATCH",
headers: {
// use the user's token to tell discord which account to update the settings for
"Authorization": token,
// set Content-Type header to tell discord what format the data is being sent as
"Content-Type": "application/json"
},
body: JSON.stringify({
// send the encoded string of `{appearance: {theme: 1 || 2,developerMode: true,mobileRedesignDisabled: true}`
"settings": encodedString
}),
}).then(res => {
// if the patch works, log "Success", if not, log "Failed"
// if it logs failed please make a comment below so i can assist
res.ok ? console.log("Success") : console.log("Failed");
})
(added comments to make it clear what the script is doing)
Compact version:
let clientData=(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m);let themeData=clientData.find(m=>m?.exports?.default?.gradientPreset!==void 0)?.exports?.default?.gradientPreset.id||clientData.find(m=>m?.exports?.default?.theme!==void 0).exports.default.theme;let gradientThemes={'0':'agoIAhABGgISACAB','1':'agwIAhABGgQSAggBIAE=','2':'agwIAhABGgQSAggCIAE=','3':'agwIAhABGgQSAggDIAE=','4':'agwIAhABGgQSAggEIAE=','5':'agwIAhABGgQSAggFIAE=','6':'agwIAhABGgQSAggGIAE=','7':'agwIAhABGgQSAggHIAE=','8':'agwIARABGgQSAggIIAE=','9':'agwIARABGgQSAggJIAE=','10':'agwIARABGgQSAggKIAE=','11':'agwIARABGgQSAggLIAE=','12':'agwIARABGgQSAggMIAE=','13':'agwIARABGgQSAggNIAE=','14':'agwIARABGgQSAggOIAE=','15':'agwIARABGgQSAggPIAE=','17':'agwIARABGgQSAggRIAE=','18':'agwIARABGgQSAggSIAE=','19':'agwIARABGgQSAggTIAE=','20':'agwIARABGgQSAggUIAE=','21':'agwIARABGgQSAggVIAE='};let token=clientData.find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken();let encodedString=typeof themeData==='string'?themeData=='light'?'agYIAhABIAE=':'agYIARABIAE=':gradientThemes[themeData];fetch("https://discord.com/api/v9/users/@me/settings-proto/1", {method: "PATCH",headers:{"Authorization":token,"Content-Type":"application/json"},body:JSON.stringify({"settings":encodedString}),}).then(res=>{res.ok?console.log("Success"):console.log("Failed");})
If something doesnt work then try the simpler version below which sets your theme to default dark mode
fetch("https://discord.com/api/v9/users/@me/settings-proto/1",{method:"PATCH",headers:{"Authorization":(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken(),"Content-Type":"application/json"},body:JSON.stringify({"settings":"ahEIARABIAEyCQoHY29tcGFjdA=="}),}).then(res=>{res.ok?console.log("Success"):console.log("Failed");})
After running the script, you should instantly go back to the old discord layout
If you run into any issues check the comments below to see if ther are any issues reported
If not, leave a comment and i would be happy to assist you
If for any reason you need to go back to the new UI and both the toggle switch is missing in appearance settings, and the sparkle emoji method isnt working, then you can run this script:
fetch("https://discord.com/api/v9/users/@me/settings-proto/1",{method:"PATCH",headers:{"Authorization":(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken(),"Content-Type":"application/json"},body:JSON.stringify({"settings":"ag8IARABMgkKB2NvbXBhY3Q="}),}).then(res=>{res.ok?console.log("Success"):console.log("Failed");})
@VampireChicken12 I can understand your position, but it is an change that you can't really fight against. People will eventually just get used to it. Besides, I do agree that the initial rollout wasn't the best but the UI has received changes and improvements. You are always free to suggest further improvements to Discord directly