diff --git a/README.md b/README.md
index 61f7293f..75b5e1e6 100644
--- a/README.md
+++ b/README.md
@@ -21,11 +21,12 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- Request for plugins from Discord.
-Extra included plugins (69 additional plugins)
+Extra included plugins (64 additional plugins)
- AllCallTimers by MaxHerbold and D3SOX
- AltKrispSwitch by newwares
- Annamox by Kyuuhachi
+- BetterActivities by D3SOX, Arjix, AutumnVN
- BetterQuests by kvba
- BetterQuickReact by Ven and Sqaaakoi
- BetterShopPreview by Tolgchu
@@ -42,7 +43,6 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- EmojiDumper by Cortex, Samwich, Woosh
- EquicordCSS by FoxStorm1 and thororen (and all respective css developers)
- ExportContacts by dat_insanity
-- FakeProfileThemes by Ryan
- FindReply by newwares
- FriendshipRanks by Samwich
- GlobalBadges by HypedDomi and Hosted by Wolfie
@@ -54,6 +54,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- IRememberYou by zoodogood
- Keyboard Sounds by HypedDomi
- KeywordNotify by camila314
+- Meow by Samwich
- MessageLinkTooltip by Kyuuhachi
- MessageLoggerEnhanced (MLEnhanced) by Aria
- noAppsAllowed by kvba
@@ -84,6 +85,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- VencordRPC by AutumnVN
- VoiceChatUtilities by Dams and D3SOX
- WhosWatching by fres
+- Woof by Samwich
- YoutubeDescription by arHSM
diff --git a/scripts/generateReport.ts b/scripts/generateReport.ts
index 5d1cfa15..ce65bc96 100644
--- a/scripts/generateReport.ts
+++ b/scripts/generateReport.ts
@@ -46,7 +46,8 @@ await page.setBypassCSP(true);
async function maybeGetError(handle: JSHandle): Promise {
return await (handle as JSHandle)?.getProperty("message")
- .then(m => m?.jsonValue());
+ .then(m => m?.jsonValue())
+ .catch(() => undefined);
}
const report = {
diff --git a/src/api/Commands/commandHelpers.ts b/src/api/Commands/commandHelpers.ts
index 2f703913..4ae022c5 100644
--- a/src/api/Commands/commandHelpers.ts
+++ b/src/api/Commands/commandHelpers.ts
@@ -17,14 +17,14 @@
*/
import { mergeDefaults } from "@utils/mergeDefaults";
-import { findByPropsLazy } from "@webpack";
+import { findByCodeLazy } from "@webpack";
import { MessageActions, SnowflakeUtils } from "@webpack/common";
import { Message } from "discord-types/general";
import type { PartialDeep } from "type-fest";
import { Argument } from "./types";
-const MessageCreator = findByPropsLazy("createBotMessage");
+const createBotMessage = findByCodeLazy('username:"Clyde"');
export function generateId() {
return `-${SnowflakeUtils.fromTimestamp(Date.now())}`;
@@ -37,7 +37,7 @@ export function generateId() {
* @returns {Message}
*/
export function sendBotMessage(channelId: string, message: PartialDeep): Message {
- const botMessage = MessageCreator.createBotMessage({ channelId, content: "", embeds: [] });
+ const botMessage = createBotMessage({ channelId, content: "", embeds: [] });
MessageActions.receiveMessage(channelId, mergeDefaults(message, botMessage));
diff --git a/src/api/SettingsStores.ts b/src/api/SettingsStores.ts
new file mode 100644
index 00000000..18139e4e
--- /dev/null
+++ b/src/api/SettingsStores.ts
@@ -0,0 +1,69 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2023 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+*/
+
+import { proxyLazy } from "@utils/lazy";
+import { Logger } from "@utils/Logger";
+import { findModuleId, proxyLazyWebpack, wreq } from "@webpack";
+
+import { Settings } from "./Settings";
+
+interface Setting {
+ /**
+ * Get the setting value
+ */
+ getSetting(): T;
+ /**
+ * Update the setting value
+ * @param value The new value
+ */
+ updateSetting(value: T | ((old: T) => T)): Promise;
+ /**
+ * React hook for automatically updating components when the setting is updated
+ */
+ useSetting(): T;
+ settingsStoreApiGroup: string;
+ settingsStoreApiName: string;
+}
+
+export const SettingsStores: Array> | undefined = proxyLazyWebpack(() => {
+ const modId = findModuleId('"textAndImages","renderSpoilers"') as any;
+ if (modId == null) return new Logger("SettingsStoreAPI").error("Didn't find stores module.");
+
+ const mod = wreq(modId);
+ if (mod == null) return;
+
+ return Object.values(mod).filter((s: any) => s?.settingsStoreApiGroup) as any;
+});
+
+/**
+ * Get the store for a setting
+ * @param group The setting group
+ * @param name The name of the setting
+ */
+export function getSettingStore(group: string, name: string): Setting | undefined {
+ if (!Settings.plugins.SettingsStoreAPI.enabled) throw new Error("Cannot use SettingsStoreAPI without setting as dependency.");
+
+ return SettingsStores?.find(s => s?.settingsStoreApiGroup === group && s?.settingsStoreApiName === name);
+}
+
+/**
+ * getSettingStore but lazy
+ */
+export function getSettingStoreLazy(group: string, name: string) {
+ return proxyLazy(() => getSettingStore(group, name));
+}
diff --git a/src/api/index.ts b/src/api/index.ts
index 02c70008..737e06d6 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -31,6 +31,7 @@ import * as $Notices from "./Notices";
import * as $Notifications from "./Notifications";
import * as $ServerList from "./ServerList";
import * as $Settings from "./Settings";
+import * as $SettingsStores from "./SettingsStores";
import * as $Styles from "./Styles";
/**
@@ -116,3 +117,5 @@ export const ChatButtons = $ChatButtons;
* An API allowing you to update and re-render messages
*/
export const MessageUpdater = $MessageUpdater;
+
+export const SettingsStores = $SettingsStores;
diff --git a/src/equicordplugins/meow/index.tsx b/src/equicordplugins/meow/index.tsx
index 27169ec1..9dd03056 100644
--- a/src/equicordplugins/meow/index.tsx
+++ b/src/equicordplugins/meow/index.tsx
@@ -25,9 +25,7 @@ export default definePlugin({
name: "Meow",
description: "Adds a chatbar button to meow in chat",
authors:
- [
- Devs.Samwich
- ],
+ [Devs.Samwich],
start() {
addChatBarButton("vc-meow", ChatBarIcon);
}
diff --git a/src/equicordplugins/woof/index.tsx b/src/equicordplugins/woof/index.tsx
index a72a6dbb..0e1f781d 100644
--- a/src/equicordplugins/woof/index.tsx
+++ b/src/equicordplugins/woof/index.tsx
@@ -25,9 +25,7 @@ export default definePlugin({
name: "Woof",
description: "Adds a chatbar button to woof in chat",
authors:
- [
- Devs.Samwich
- ],
+ [Devs.Samwich],
start() {
addChatBarButton("vc-woof", ChatBarIcon);
}
diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx
index 5989b58a..0f2f8101 100644
--- a/src/plugins/_api/badges/index.tsx
+++ b/src/plugins/_api/badges/index.tsx
@@ -111,7 +111,7 @@ export default definePlugin({
{
find: ".PANEL]:14",
replacement: {
- match: /(?<=(\i)=\(0,\i\.default\)\(\i\);)return 0===\i.length\?/,
+ match: /(?<=(\i)=\(0,\i\.\i\)\(\i\);)return 0===\i.length\?/,
replace: "$1.unshift(...$self.getBadges(arguments[0].displayProfile));$&"
}
},
diff --git a/src/plugins/_api/settingsStores.ts b/src/plugins/_api/settingsStores.ts
new file mode 100644
index 00000000..a888532e
--- /dev/null
+++ b/src/plugins/_api/settingsStores.ts
@@ -0,0 +1,43 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2022 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+*/
+
+import { Devs } from "@utils/constants";
+import definePlugin from "@utils/types";
+
+export default definePlugin({
+ name: "SettingsStoreAPI",
+ description: "Patches Discord's SettingsStores to expose their group and name",
+ authors: [Devs.Nuckyz],
+
+ patches: [
+ {
+ find: ",updateSetting:",
+ replacement: [
+ {
+ match: /(?<=INFREQUENT_USER_ACTION.{0,20}),useSetting:/,
+ replace: ",settingsStoreApiGroup:arguments[0],settingsStoreApiName:arguments[1]$&"
+ },
+ // some wrapper. just make it copy the group and name
+ {
+ match: /updateSetting:.{0,20}shouldSync/,
+ replace: "settingsStoreApiGroup:arguments[0].settingsStoreApiGroup,settingsStoreApiName:arguments[0].settingsStoreApiName,$&"
+ }
+ ]
+ }
+ ]
+});
diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx
index ba0fef42..7be0a8f9 100644
--- a/src/plugins/_core/settings.tsx
+++ b/src/plugins/_core/settings.tsx
@@ -93,8 +93,8 @@ export default definePlugin({
{
find: "Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",
replacement: {
- match: /(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.UserSettingsSections\).*?(\i)\.default\.open\()/,
- replace: "$2.default.open($1);return;"
+ match: /(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.\i\).*?(\i\.\i)\.open\()/,
+ replace: "$2.open($1);return;"
}
}
],
@@ -181,7 +181,7 @@ export default definePlugin({
patchedSettings: new WeakSet(),
addSettings(elements: any[], element: { header?: string; settings: string[]; }, sectionTypes: SectionTypes) {
- if (this.patchedSettings.has(elements)) return;
+ if (this.patchedSettings.has(elements) || !this.isRightSpot(element)) return;
this.patchedSettings.add(elements);
diff --git a/src/plugins/arRPC.web/index.tsx b/src/plugins/arRPC.web/index.tsx
index e41e8675..df307e75 100644
--- a/src/plugins/arRPC.web/index.tsx
+++ b/src/plugins/arRPC.web/index.tsx
@@ -20,10 +20,10 @@ import { popNotice, showNotice } from "@api/Notices";
import { Link } from "@components/Link";
import { Devs } from "@utils/constants";
import definePlugin, { ReporterTestable } from "@utils/types";
-import { findByPropsLazy } from "@webpack";
+import { findByCodeLazy } from "@webpack";
import { ApplicationAssetUtils, FluxDispatcher, Forms, Toasts } from "@webpack/common";
-const RpcUtils = findByPropsLazy("fetchApplicationsRPC", "getRemoteIconURL");
+const fetchApplicationsRPC = findByCodeLazy("APPLICATION_RPC(", "Client ID");
async function lookupAsset(applicationId: string, key: string): Promise {
return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];
@@ -32,7 +32,7 @@ async function lookupAsset(applicationId: string, key: string): Promise
const apps: any = {};
async function lookupApp(applicationId: string): Promise {
const socket: any = {};
- await RpcUtils.fetchApplicationsRPC(socket, applicationId);
+ await fetchApplicationsRPC(socket, applicationId);
return socket.application;
}
diff --git a/src/plugins/betterGifAltText/index.ts b/src/plugins/betterGifAltText/index.ts
index f0090343..55fa2252 100644
--- a/src/plugins/betterGifAltText/index.ts
+++ b/src/plugins/betterGifAltText/index.ts
@@ -36,7 +36,7 @@ export default definePlugin({
{
find: ".Messages.GIF,",
replacement: {
- match: /alt:(\i)=(\i\.default\.Messages\.GIF)(?=,[^}]*\}=(\i))/,
+ match: /alt:(\i)=(\i\.\i\.Messages\.GIF)(?=,[^}]*\}=(\i))/,
replace:
// rename prop so we can always use default value
"alt_$$:$1=$self.altify($3)||$2",
diff --git a/src/plugins/betterRoleContext/index.tsx b/src/plugins/betterRoleContext/index.tsx
index ecb1ed40..d69e188c 100644
--- a/src/plugins/betterRoleContext/index.tsx
+++ b/src/plugins/betterRoleContext/index.tsx
@@ -5,15 +5,18 @@
*/
import { definePluginSettings } from "@api/Settings";
+import { getSettingStoreLazy } from "@api/SettingsStores";
import { ImageIcon } from "@components/Icons";
import { Devs } from "@utils/constants";
import { getCurrentGuild, openImageModal } from "@utils/discord";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
-import { Clipboard, GuildStore, Menu, PermissionStore, TextAndImagesSettingsStores } from "@webpack/common";
+import { Clipboard, GuildStore, Menu, PermissionStore } from "@webpack/common";
const GuildSettingsActions = findByPropsLazy("open", "selectRole", "updateGuild");
+const DeveloperMode = getSettingStoreLazy("appearance", "developerMode")!;
+
function PencilIcon() {
return (