From 5c8ac17e02aed4fcab6ed4e4038154938560f551 Mon Sep 17 00:00:00 2001 From: nin0dev Date: Sat, 22 Feb 2025 17:07:17 -0500 Subject: [PATCH] init --- LICENSE | 13 +++++++++++++ index.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 LICENSE create mode 100644 index.ts diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c6c7def --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..e4acaec --- /dev/null +++ b/index.ts @@ -0,0 +1,48 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { definePluginSettings } from "@api/Settings"; +import { Devs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; + +const settings = definePluginSettings({ + disableSpotify: { + default: true, + type: OptionType.BOOLEAN, + description: "Do not send track history to Discord" + }, + disableGames: { + default: true, + type: OptionType.BOOLEAN, + description: "Do not send game activity to Discord" + } +}); + +export default definePlugin({ + name: "NoActivityFeedSend", + description: "Disables sending activity/Spotify history to Discord, effectively hiding it from activity history", + authors: [Devs.nin0dev], + enabledByDefault: true, + settings, + patches: [ + { + find: "for_game_profile", + replacement: { + match: /await \i.\i.post\({url:\i.\i.MY_SPOTIFY_CONTENT_INVENTORY.{0,100}}\)/, + replace: "(()=>{})()" + }, + predicate: () => settings.store.disableSpotify + }, + { + find: "MY_CONTENT_INVENTORY_APPLICATION(", + replacement: { + match: /await \i.\i.post\({url:\i.\i.MY_CONTENT_INVENTORY_APPLICATION.{0,100}}\)/, + replace: "(()=>{})()" + }, + predicate: () => settings.store.disableGames + } + ] +});