Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wont-stream committed Sep 23, 2024
1 parent 813a24b commit 74144ba
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 199 deletions.
2 changes: 0 additions & 2 deletions plugins/eurotilities/helpers/modules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import alwaysTrust from "../modules/alwaysTrust.ts";
import antiTrack from "../modules/antiTrack.ts";
import colorSighted from "../modules/colorSighted.ts";
import muteNewGuild from "../modules/muteNewGuild.ts";
import noCallIdle from "../modules/noCallIdle.ts";
import noConsoleSpam from "../modules/noConsoleSpam.ts";
Expand All @@ -15,7 +14,6 @@ import timestampedFiles from "../modules/timestampedFiles.ts";
export default {
alwaysTrust,
antiTrack,
colorSighted,
muteNewGuild,
noCallIdle,
noConsoleSpam,
Expand Down
2 changes: 1 addition & 1 deletion plugins/eurotilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {

export function onLoad() {
for (const module of Object.keys(modules)) {
modules[module].start();
modules[module]();
}
}

Expand Down
8 changes: 2 additions & 6 deletions plugins/eurotilities/modules/alwaysTrust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ const { stores } = flux;
const { instead } = patcher;
const { MaskedLinkStore } = stores;

export default {
title: "Always Trust",
content: 'Remove the "You are leaving Discord" popup.',
start: () => {
instead("isTrustedDomain", MaskedLinkStore, () => true, false);
},
export default () => {
instead("isTrustedDomain", MaskedLinkStore, () => true, false);
};
38 changes: 17 additions & 21 deletions plugins/eurotilities/modules/antiTrack.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
const { http } = shelter;
const { intercept } = http;

export default {
title: "Anti Track",
content: "Stop some tracking, not all.",
start: () => {
try {
(
window as unknown as {
__SENTRY__: {
hub: {
getClient: () => { getOptions: () => { enabled: boolean } };
};
export default () => {
try {
(
window as unknown as {
__SENTRY__: {
hub: {
getClient: () => { getOptions: () => { enabled: boolean } };
};
}
).__SENTRY__.hub
.getClient()
.getOptions().enabled = false;
for (const x of Object.keys(console)) {
console[x] = console[x].__sentry_original__ ?? console[x];
};
}
} catch {}
).__SENTRY__.hub
.getClient()
.getOptions().enabled = false;
for (const x of Object.keys(console)) {
console[x] = console[x].__sentry_original__ ?? console[x];
}
} catch {}

// @ts-ignore
intercept("post", /^\/science|^\/error-reporting-proxy/, () => {});
},
// @ts-ignore
intercept("post", /^\/science|^\/error-reporting-proxy/, () => {});
};
32 changes: 0 additions & 32 deletions plugins/eurotilities/modules/colorSighted.ts

This file was deleted.

44 changes: 20 additions & 24 deletions plugins/eurotilities/modules/muteNewGuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@ const { flux, http } = shelter;
const { dispatcher } = flux;
const { patch } = http;

export default {
title: "Mute New Guilds",
content: "Auto mute guilds on join.",
start: () => {
dispatcher.subscribe(
"INVITE_ACCEPT_SUCCESS",
({
invite: {
guild: { id },
},
}) => {
if (patch) {
patch({
body: {
muted: true,
suppress_everyone: true,
suppress_roles: true,
},
url: `/users/@me/guilds/${id}/settings`,
oldFormErrors: false,
});
}
export default () => {
dispatcher.subscribe(
"INVITE_ACCEPT_SUCCESS",
({
invite: {
guild: { id },
},
);
},
}) => {
if (patch) {
patch({
body: {
muted: true,
suppress_everyone: true,
suppress_roles: true,
},
url: `/users/@me/guilds/${id}/settings`,
oldFormErrors: false,
});
}
},
);
};
22 changes: 9 additions & 13 deletions plugins/eurotilities/modules/noCallIdle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ const { intercept, dispatcher } = flux;

const dispatchTypes = ["EMBEDDED_ACTIVITY_DISCONNECT", "VOICE_STATE_UPDATES"];

export default {
title: "No Call Idle",
content: "Stay in VC forever.",
start: () => {
intercept(({ type }) => {
if (dispatchTypes.includes(type)) {
const actionHandlers = dispatcher._subscriptions[type] ?? [];
export default () => {
intercept(({ type }) => {
if (dispatchTypes.includes(type)) {
const actionHandlers = dispatcher._subscriptions[type] ?? [];

for (const handler of actionHandlers) {
if (handler.toString().includes("idleTimeout.start")) {
actionHandlers.delete(handler);
}
for (const handler of actionHandlers) {
if (handler.toString().includes("idleTimeout.start")) {
actionHandlers.delete(handler);
}
}
});
},
}
});
};
32 changes: 14 additions & 18 deletions plugins/eurotilities/modules/noConsoleSpam.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
const originalConsoleMethods: { [key: string]: (...args: unknown[]) => void } =
{};

export default {
title: "No Console Spam",
content: "Filter the console spam.",
start: () => {
for (const method of Object.keys(console)) {
originalConsoleMethods[method] = console[method];
export default () => {
for (const method of Object.keys(console)) {
originalConsoleMethods[method] = console[method];

console[method] = (...args: unknown[]) => {
const message = args[0];
if (
typeof message === "string" &&
(message.includes("%c[") || message.toLowerCase().includes("sentry"))
) {
return;
}
originalConsoleMethods[method].apply(console, args);
};
}
},
console[method] = (...args: unknown[]) => {
const message = args[0];
if (
typeof message === "string" &&
(message.includes("%c[") || message.toLowerCase().includes("sentry"))
) {
return;
}
originalConsoleMethods[method].apply(console, args);
};
}
};
20 changes: 8 additions & 12 deletions plugins/eurotilities/modules/noDevtoolsDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ const nativeWindow = window as unknown as {
};
};

export default {
title: "No Devtools Detection",
content: "Prevent annoying devtools detection. (Desktop only)",
start: () => {
if (nativeWindow.DiscordNative) {
// desktop, cannot be unloaded easily
nativeWindow.DiscordNative.window.setDevtoolsCallbacks(
() => {},
() => {},
);
}
},
export default () => {
if (nativeWindow.DiscordNative) {
// desktop, cannot be unloaded easily
nativeWindow.DiscordNative.window.setDevtoolsCallbacks(
() => {},
() => {},
);
}
};
15 changes: 5 additions & 10 deletions plugins/eurotilities/modules/noNitroUpsell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@ const getUser = async () => {
return user;
};

export default {
title: "No Nitro Upsell",
content:
"Remove ALL of Discord's nitro upsells by tricking the client into thinking you have nitro.",
start: async () => {
const user = await getUser();

user._eurotilities__premiumType = user.premiumType;
user.premiumType = 2;
},
export default async () => {
const user = await getUser();

user._eurotilities__premiumType = user.premiumType;
user.premiumType = 2;
};
14 changes: 5 additions & 9 deletions plugins/eurotilities/modules/noReplyMention.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
const { flux } = shelter;
const { intercept } = flux;

export default {
title: "No Reply Mention",
content: "Disable replies by default.",
start: () => {
intercept((dispatch) => {
if (dispatch.type !== "CREATE_PENDING_REPLY") return;
export default () => {
intercept((dispatch) => {
if (dispatch.type !== "CREATE_PENDING_REPLY") return;

dispatch.shouldMention = false;
});
},
dispatch.shouldMention = false;
});
};
10 changes: 3 additions & 7 deletions plugins/eurotilities/modules/noTyping.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const { http } = shelter;
const { intercept } = http;

export default {
title: "No Typing",
content: "Stop Discord from sending your typing status.",
start: () => {
// @ts-ignore
intercept("post", /.*typing$/, () => {});
},
export default () => {
// @ts-ignore
intercept("post", /.*typing$/, () => {});
};
12 changes: 4 additions & 8 deletions plugins/eurotilities/modules/noTypingAnimation.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
export default {
title: "No Typing Animation",
content: "Disable the CPU-intensive typing dots animation.",
start: () => {
document.hasFocus = () => {
return false;
};
},
export default () => {
document.hasFocus = () => {
return false;
};
};
28 changes: 11 additions & 17 deletions plugins/eurotilities/modules/steamStatusSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,17 @@ const statusMap = {
invisible: "invisible",
};

const listener = ({ settings }) => {
const protoStatus = settings.proto.status;
const discordStatus = protoStatus.status.value;
const showCurrentGame = protoStatus.showCurrentGame.value;
const steamStatus = statusMap[discordStatus];
export default () => {
dispatcher.subscribe("USER_SETTINGS_PROTO_UPDATE", ({ settings }) => {
const protoStatus = settings.proto.status;
const discordStatus = protoStatus.status.value;
const showCurrentGame = protoStatus.showCurrentGame.value;
const steamStatus = statusMap[discordStatus];

if (!showCurrentGame) {
return open("steam://friends/status/invisible");
}
if (!showCurrentGame) {
return open("steam://friends/status/invisible");
}

return open(`steam://friends/status/${steamStatus}`);
};

export default {
title: "Steam Status Sync",
content: "Sync your Steam Status to your Discord Status.",
start: () => {
dispatcher.subscribe("USER_SETTINGS_PROTO_UPDATE", listener);
},
return open(`steam://friends/status/${steamStatus}`);
});
};
Loading

0 comments on commit 74144ba

Please sign in to comment.