prettierify

typescript
Drake 2 years ago
parent 55990778aa
commit d755b72ce7

@ -1,4 +1,5 @@
# Demoncord # Demoncord
[![Discord](https://img.shields.io/discord/928470798887452692?color=%23ab8eda&label=Discord&logo=Discord&logoColor=%23ffffff)](https://discord.gg/GQajVzaxvY) [![Discord](https://img.shields.io/discord/928470798887452692?color=%23ab8eda&label=Discord&logo=Discord&logoColor=%23ffffff)](https://discord.gg/GQajVzaxvY)
A discord client mod by satanists for satanists (if your definition of satanist is a member of the Hazbin Hotel fandom) A discord client mod by satanists for satanists (if your definition of satanist is a member of the Hazbin Hotel fandom)
@ -40,8 +41,7 @@ Because it's
- Will break at the slightest poke or prod (related to the first one) - Will break at the slightest poke or prod (related to the first one)
# Screenshots # Screenshots
![Image of the Demoncord plugins menu](screenshots/1.png)
![Image of the Demoncord plugins menu](screenshots/1.png)
<iframe src="https://discord.com/widget?id=928470798887452692&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe> <iframe src="https://discord.com/widget?id=928470798887452692&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>

@ -11,14 +11,14 @@ import { readFileSync as readFile, existsSync as fileExists } from "fs";
const projectRootDir = resolvePath(__dirname); const projectRootDir = resolvePath(__dirname);
let data let data;
if (fileExists("options.toml")) { if (fileExists("options.toml")) {
data = readFile("options.toml") data = readFile("options.toml");
} else if (fileExists("options.default.toml")) { } else if (fileExists("options.default.toml")) {
data = readFile("options.default.toml") data = readFile("options.default.toml");
} else { } else {
throw new Error("Could not find options file") throw new Error("Could not find options file");
} }
export default defineConfig({ export default defineConfig({

@ -1,57 +1,61 @@
import webpack from "./webpack.js" import webpack from "./webpack.js";
import { instead } from "./patcher.js" import { instead } from "./patcher.js";
import { leak } from "./utils/memory.js" import { leak } from "./utils/memory.js";
const sins = { const sins = {
"Lust": null, Lust: null,
"Pride": null, Pride: null,
"Greed": null, Greed: null,
"Wrath": null, Wrath: null,
"Envy": null, Envy: null,
"Gluttony": () => { Gluttony: () => {
//slowly memory leak to make the app notably slower (perhaps even slothier) //slowly memory leak to make the app notably slower (perhaps even slothier)
setInterval(() => { setInterval(() => {
leak(6.66) leak(6.66);
}, 500) }, 500);
}, },
"Sloth": () => { Sloth: () => {
//replace some influencial functions to make them wait time //replace some influencial functions to make them wait time
instead(webpack.findByProps("_actionHandlers").__proto__, "dispatch", (args, orig) => { instead(
webpack.findByProps("_actionHandlers").__proto__,
"dispatch",
(args, orig) => {
let res; let res;
setTimeout(() => { setTimeout(() => {
res = orig(...args) res = orig(...args);
}, 500) }, 500);
while (!res) {} while (!res) {}
return res return res;
})
} }
);
} }
};
const rulers = { const rulers = {
"Asmodeus": "Lust", Asmodeus: "Lust",
"Lucifer": "Pride", Lucifer: "Pride",
"Mammon": "Greed", Mammon: "Greed",
"Satan": "Wrath", Satan: "Wrath",
"Leviathan": "Envy", Leviathan: "Envy",
"Beelzebub": "Gluttony", Beelzebub: "Gluttony",
"Belphegor": "Sloth" Belphegor: "Sloth"
} };
function ritualFail(sin) { function ritualFail(sin) {
if (Math.random() > 0.5) { if (Math.random() > 0.5) {
//use generic failstates //use generic failstates
//TODO: add nerd moxxie image and make it play the MLG clip on top of the screen and also make it patch sendMessage and replace every message with something funny idk i'll figure it out later //TODO: add nerd moxxie image and make it play the MLG clip on top of the screen and also make it patch sendMessage and replace every message with something funny idk i'll figure it out later
throw `Illegal Invocation of a sin!` throw `Illegal Invocation of a sin!`;
} else { } else {
if (sin in sins) { if (sin in sins) {
if (!sins[sin]) { if (!sins[sin]) {
throw `Illegal Invocation of a sin!` throw `Illegal Invocation of a sin!`;
} else { } else {
sins[sin]() sins[sin]();
} }
} else { } else {
console.log("WTF did you do") console.log("WTF did you do");
console.log(sin) console.log(sin);
//window.location.reload() //window.location.reload()
} }
} }
@ -61,78 +65,92 @@ function findByRitual(incantation) {
// I call upon the ___ of ___, ___, to ___ the ___ ___ with a ___ of name ___! // I call upon the ___ of ___, ___, to ___ the ___ ___ with a ___ of name ___!
// I call upon the embodiment of lust, Asmodeus, to bring forth the imposing object with a property of name FluxDispatcher! // I call upon the embodiment of lust, Asmodeus, to bring forth the imposing object with a property of name FluxDispatcher!
//TODO: should we do "I call upon the [great/almighty/etc].." instead of just "the"? //TODO: should we do "I call upon the [great/almighty/etc].." instead of just "the"?
const args = incantation.split(" ") const args = incantation.split(" ");
if (args.shift() !== "I" || args.shift() !== "call" || args.shift() !== "upon" || args.shift() !== "the") { if (
ritualFail(sins[Math.floor(Math.random() * sins.length)]) args.shift() !== "I" ||
return args.shift() !== "call" ||
} args.shift() !== "upon" ||
const embodiment = args.shift() args.shift() !== "the"
if (!(embodiment === "embodiment" || (embodiment === "king" && args.shift() === "sin"))) { //absolutely no clue where i heard them referred to as "king sin of X" before, but i think it sounds cool so i'll keep it ) {
ritualFail(sins[Math.floor(Math.random() * sins.length)]);
return;
}
const embodiment = args.shift();
if (
!(
embodiment === "embodiment" ||
(embodiment === "king" && args.shift() === "sin")
)
) {
//absolutely no clue where i heard them referred to as "king sin of X" before, but i think it sounds cool so i'll keep it
//how did you even fuck this one up //how did you even fuck this one up
ritualFail(sins[Math.floor(Math.random() * sins.length)]) ritualFail(sins[Math.floor(Math.random() * sins.length)]);
return return;
} }
if (args.shift() !== "of") { if (args.shift() !== "of") {
ritualFail(sin) ritualFail(sin);
} }
const sin = args.shift().replace(",", "") const sin = args.shift().replace(",", "");
if (!(sin in sins)) { if (!(sin in sins)) {
//invalid sin, so we can't use it //invalid sin, so we can't use it
ritualFail(sins[Math.floor(Math.random() * sins.length)]) ritualFail(sins[Math.floor(Math.random() * sins.length)]);
return return;
} }
const ruler = args.shift().replace(",", "") const ruler = args.shift().replace(",", "");
if (!(ruler in rulers)) { if (!(ruler in rulers)) {
//invalid ruler, so we still can't use it //invalid ruler, so we still can't use it
//use the sin punishment //use the sin punishment
ritualFail(sin) ritualFail(sin);
} }
if (rulers[ruler] !== sin) { if (rulers[ruler] !== sin) {
//sin/ruler mismatch //sin/ruler mismatch
//i feel it's more fitting to call the sin of the demon, instead of the sin you provided, as you would've angered the ruler for calling them for the wrong sin //i feel it's more fitting to call the sin of the demon, instead of the sin you provided, as you would've angered the ruler for calling them for the wrong sin
ritualFail(rulers[ruler]) ritualFail(rulers[ruler]);
} }
if (args.shift() !== "to") { if (args.shift() !== "to") {
ritualFail(sin) ritualFail(sin);
} }
if (args.shift() !== "summon") { //TODO: we want to accept either "summon" or "bring forth" here but i cbf rn if (args.shift() !== "summon") {
ritualFail(sin) //TODO: we want to accept either "summon" or "bring forth" here but i cbf rn
ritualFail(sin);
} }
if (args.shift() !== "the") { if (args.shift() !== "the") {
ritualFail(sin) ritualFail(sin);
} }
const adjective = args.shift() const adjective = args.shift();
if (adjective !== "imposing" && adjective !== "foreboding") { //TODO: sin-specific adjectives if (adjective !== "imposing" && adjective !== "foreboding") {
ritualFail(sin) //TODO: sin-specific adjectives
ritualFail(sin);
} }
const descriptor = args.shift() const descriptor = args.shift();
if (descriptor !== "object" && descriptor !== "element") { //TODO: typecheck this shit if (descriptor !== "object" && descriptor !== "element") {
ritualFail(sin) //TODO: typecheck this shit
ritualFail(sin);
} }
if (args.shift() !== "with" || args.shift() !== "a") { if (args.shift() !== "with" || args.shift() !== "a") {
ritualFail(sin) ritualFail(sin);
} }
const filter = args.shift() const filter = args.shift();
if (filter !== "display" && filter !== "property") { if (filter !== "display" && filter !== "property") {
ritualFail(sin) ritualFail(sin);
} }
if (args.shift() !== "of" || args.shift() !== "name") { if (args.shift() !== "of" || args.shift() !== "name") {
ritualFail(sin) ritualFail(sin);
} }
//TODO: HOW THE FUCK ARE WE SUPPOSED TO DO MULTIPLE PROPS? //TODO: HOW THE FUCK ARE WE SUPPOSED TO DO MULTIPLE PROPS?
const prop = args.shift().slice(0,-1) const prop = args.shift().slice(0, -1);
switch (filter) { switch (filter) {
case "display": case "display":
return webpack.findByDisplayName(prop) return webpack.findByDisplayName(prop);
break break;
case "property": case "property":
return webpack.findByProps(prop) return webpack.findByProps(prop);
break break;
default: default:
// the only way you can get here is with cosmic rays or divine intervention // the only way you can get here is with cosmic rays or divine intervention
ritualFail(sin) ritualFail(sin);
break break;
} }
} }
export default findByRitual export default findByRitual;

@ -23,9 +23,7 @@ export default class HummusUI extends React.Component {
<span> <span>
<Checkbox <Checkbox
className={`demon-stub-plugin-checkbox-${k}`} className={`demon-stub-plugin-checkbox-${k}`}
checked={ checked={extNest.ghost.plugins[k].enabled}
extNest.ghost.plugins[k].enabled
}
onChange={async () => { onChange={async () => {
toggle(k); toggle(k);
const ele = const ele =
@ -33,9 +31,7 @@ export default class HummusUI extends React.Component {
`demon-stub-plugin-checkbox-${k}` `demon-stub-plugin-checkbox-${k}`
)[0]; )[0];
//ele.value = extNest.ghost.pluginsStatus[k].running //ele.value = extNest.ghost.pluginsStatus[k].running
if ( if (!extNest.ghost.plugins[k].enabled) {
!extNest.ghost.plugins[k].enabled
) {
ele.value = "on"; ele.value = "on";
} else { } else {
ele.value = "off"; ele.value = "off";

@ -2,9 +2,11 @@
export function leak(mb) { export function leak(mb) {
if (!window.beelzejuice) { if (!window.beelzejuice) {
window.beelzejuice = {} //weird fanfic reference; i've seen this name used multiple times for alcoholic beverages window.beelzejuice = {}; //weird fanfic reference; i've seen this name used multiple times for alcoholic beverages
} }
const id = Math.random().toString(36).slice(2) const id = Math.random().toString(36).slice(2);
window.beelzejuice[id] = new Uint8Array(Math.floor(mb * 1024 * 1024)).fill(666) window.beelzejuice[id] = new Uint8Array(Math.floor(mb * 1024 * 1024)).fill(
return () => delete window.beelzejuice[id] 666
);
return () => delete window.beelzejuice[id];
} }

@ -9,7 +9,7 @@ import findByRitual from "./api/ritual.js";
Object.assign(webpack, { Object.assign(webpack, {
findByRitual findByRitual
}) });
const demon = { const demon = {
modules: { modules: {

@ -3,25 +3,28 @@
// - make the jscc plugin work properly // - make the jscc plugin work properly
//why doesn't rollup watch do either of these things? no idea! //why doesn't rollup watch do either of these things? no idea!
const loadConfigFile = require('rollup/loadConfigFile'); const loadConfigFile = require("rollup/loadConfigFile");
const path = require('path'); const path = require("path");
const rollup = require('rollup'); const rollup = require("rollup");
const chokidar = require('chokidar') const chokidar = require("chokidar");
const process = require('child_process') const process = require("child_process");
let ready = false let ready = false;
const watch = chokidar.watch(["./src", "./options.toml", "./rollup.config.js"], { const watch = chokidar.watch(
["./src", "./options.toml", "./rollup.config.js"],
{
persistent: true persistent: true
}) }
);
watch.on("all", async (eve, path) => { watch.on("all", async (eve, path) => {
if (ready) { if (ready) {
process.execSync("pnpm run build") process.execSync("pnpm run build");
} }
}) });
watch.on("ready", () => { watch.on("ready", () => {
console.log(`Watching files...`) console.log(`Watching files...`);
ready = true ready = true;
}) });

Loading…
Cancel
Save