Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brendan-rius/5004609865da26733ff140fee0ab595d to your computer and use it in GitHub Desktop.
Save brendan-rius/5004609865da26733ff140fee0ab595d to your computer and use it in GitHub Desktop.
Enable Discord Developer Menus in any environment except mobile app without BetterDiscord using Console.
(() => {
// Extracted from Samogot's LibDiscordInternals for BetterDiscord.
const req = typeof(webpackJsonp) === "function" ? webpackJsonp([], {
'__extra_id__': (module, exports, req) => exports.default = req
}, ['__extra_id__']).default : webpackJsonp.push([[], {
'__extra_id__': (module, exports, req) => module.exports = req
}, [['__extra_id__']]]);
delete req.m['__extra_id__'];
delete req.c['__extra_id__'];
const find = (filter, options = {}) => {
const {cacheOnly = true} = options;
for (let i in req.c) {
if (req.c.hasOwnProperty(i)) {
let m = req.c[i].exports;
if (m && m.__esModule && m.default && filter(m.default))
return m.default;
if (m && filter(m))
return m;
}
}
if (cacheOnly) {
console.warn('Cannot find loaded module in cache');
return null;
}
console.warn('Cannot find loaded module in cache. Loading all modules may have unexpected side effects');
for (let i = 0; i < req.m.length; ++i) {
try {
let m = req(i);
if (m && m.__esModule && m.default && filter(m.default))
return m.default;
if (m && filter(m))
return m;
}
catch (e) {
}
}
console.warn('Cannot find module');
return null;
};
const findByUniqueProperties = (propNames, options) => find(module => propNames.every(prop => module[prop] !== undefined), options);
// https://github.com/Inve1951/BetterDiscordStuff/blob/master/plugins/discordexperiments.plugin.js
Object.defineProperty(findByUniqueProperties(["isDeveloper"]),"isDeveloper",{get:_=>1,set:_=>_,configurable:true});
})();
@Flameklous
Copy link

const req = webpackJsonp.push([[], { extra_id: (module, exports, req) => (module.exports = req) }, [['extra_id']]]); for (let i in req.c) { if (req.c.hasOwnProperty(i)) { let m = req.c[i].exports; if (m && m.__esModule && m.default && m.default.getCurrentUser) { m.default.getCurrentUser().flags |= 1; break; } } }

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