aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/apiSettingsStore.ts
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-04-02 21:13:44 -0300
committerGitHub <noreply@github.com>2023-04-03 02:13:44 +0200
commitae80749dd80b69fd269df23956c66832951ebcd5 (patch)
treebbe476334c335301271709be53a0e9e5a812d841 /src/plugins/apiSettingsStore.ts
parent8c47b7080d1b16df319cfadbc442f8a25e5a5a49 (diff)
downloadVencord-ae80749dd80b69fd269df23956c66832951ebcd5.tar.gz
Vencord-ae80749dd80b69fd269df23956c66832951ebcd5.tar.bz2
Vencord-ae80749dd80b69fd269df23956c66832951ebcd5.zip
Game Activity Toggle and SettingsStoreAPI (#587)
Diffstat (limited to 'src/plugins/apiSettingsStore.ts')
-rw-r--r--src/plugins/apiSettingsStore.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/plugins/apiSettingsStore.ts b/src/plugins/apiSettingsStore.ts
new file mode 100644
index 0000000..ca1dc65
--- /dev/null
+++ b/src/plugins/apiSettingsStore.ts
@@ -0,0 +1,38 @@
+/*
+ * 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 <https://www.gnu.org/licenses/>.
+*/
+
+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: '"textAndImages","renderSpoilers"',
+ replacement: [
+ {
+ match: /(?<=INFREQUENT_USER_ACTION.{0,20}),useSetting:function/,
+ replace: ",settingsStoreApiGroup:arguments[0],settingsStoreApiName:arguments[1]$&"
+ }
+ ]
+ }
+ ]
+});