Skip to content

Instantly share code, notes, and snippets.

@R00tFS
Last active November 20, 2022 00:23
Show Gist options
  • Save R00tFS/b72750133b7e09e4ff2c7a2ccec46e7e to your computer and use it in GitHub Desktop.
Save R00tFS/b72750133b7e09e4ff2c7a2ccec46e7e to your computer and use it in GitHub Desktop.
ForceDarkMode beta
function m(o){window.enmity.plugins.registerPlugin(o)}var i="ForceDarkMode",s="1.0.0",c="Force Dark Mode when enmity restarts.",d=[{name:"bibi_fire",id:"448800441690619915"},{name:"Yan.",id:"735538297815957584"}],r={name:i,version:s,description:c,authors:d};window.enmity.modules.common.Constants,window.enmity.modules.common.Clipboard,window.enmity.modules.common.Assets,window.enmity.modules.common.Messages,window.enmity.modules.common.Clyde,window.enmity.modules.common.Avatars,window.enmity.modules.common.Native,window.enmity.modules.common.React,window.enmity.modules.common.Dispatcher,window.enmity.modules.common.Storage;const e=window.enmity.modules.common.Toasts;window.enmity.modules.common.Dialog;const n=window.enmity.modules.common.Token;window.enmity.modules.common.REST,window.enmity.modules.common.Settings,window.enmity.modules.common.Users,window.enmity.modules.common.Navigation,window.enmity.modules.common.NavigationNative,window.enmity.modules.common.NavigationStack,window.enmity.modules.common.Theme,window.enmity.modules.common.Linking,window.enmity.modules.common.StyleSheet,window.enmity.modules.common.ColorMap,window.enmity.modules.common.Components,window.enmity.modules.common.Locale,window.enmity.modules.common.Profiles,window.enmity.modules.common.Lodash,window.enmity.modules.common.Logger,window.enmity.modules.common.Flux,window.enmity.modules.common.SVG,window.enmity.modules.common.Scenes,window.enmity.modules.common.Moment;function t(o){return window.enmity.assets.getIDByName(o)}async function a(){fetch("https://discord.com/api/v9/users/@me/settings-proto/1",{headers:{accept:"*/*","accept-language":"fr,fr-FR;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",authorization:n.getToken(),"content-type":"application/json","sec-ch-ua":'"Microsoft Edge";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-debug-options":"bugReporterEnabled","x-discord-locale":"en-US",Referer:"https://discord.com/channels/@me","Referrer-Policy":"strict-origin-when-cross-origin"},body:'{"settings":"agQIAhAB"}',method:"PATCH"}).then(o=>{o.status===200?console.log("[ForceDarkMode] Switching to dark mode..."):console.log(`[ForceDarkMode] There was an error (${o.status})
${o.json} !`)})}async function w(){fetch("https://discord.com/api/v9/users/@me/settings-proto/1",{headers:{accept:"*/*","accept-language":"fr,fr-FR;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",authorization:n.getToken(),"content-type":"application/json","sec-ch-ua":'"Microsoft Edge";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-debug-options":"bugReporterEnabled","x-discord-locale":"en-US",Referer:"https://discord.com/channels/@me","Referrer-Policy":"strict-origin-when-cross-origin"},body:'{"settings":"agQIARAB"}',method:"PATCH"}).then(o=>{o.status!=200?(console.log(`[ForceDarkMode] There was an error ${o.status}.
${o.json} !`),e.open({content:"Something went wrong...",source:t("ic_alert")})):(console.log("[ForceDarkMode] Switching to dark mod was successful !"),e.open({content:"Changed to Dark Mode",source:t("ic_success")}))})}const u={...r,onStart(){setTimeout(()=>{a(),setTimeout(()=>w(),500)},5e3)},onStop(){}};m(u);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment