diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/index.ts | 5 | ||||
-rw-r--r-- | src/plugins/messageActions.ts | 3 | ||||
-rw-r--r-- | src/plugins/noTrack.ts | 3 | ||||
-rw-r--r-- | src/plugins/settings.ts | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/index.ts b/src/plugins/index.ts index d5b419b..ae67f4f 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -1,4 +1,5 @@ import Plugins from "plugins"; +import { Settings } from "../api/settings"; import Logger from "../utils/logger"; import { Patch } from "../utils/types"; @@ -7,7 +8,7 @@ const logger = new Logger("PluginManager", "#a6d189"); export const plugins = Plugins; export const patches = [] as Patch[]; -for (const plugin of Plugins) if (plugin.patches) { +for (const plugin of Plugins) if (plugin.patches && Settings.plugins[plugin.name].enabled) { for (const patch of plugin.patches) { patch.plugin = plugin.name; if (!Array.isArray(patch.replacement)) patch.replacement = [patch.replacement]; @@ -16,7 +17,7 @@ for (const plugin of Plugins) if (plugin.patches) { } export function startAll() { - for (const plugin of plugins) if (plugin.start) { + for (const plugin of plugins) if (plugin.start && Settings.plugins[plugin.name].enabled) { try { logger.info("Starting plugin", plugin.name); plugin.start(); diff --git a/src/plugins/messageActions.ts b/src/plugins/messageActions.ts index c2857cb..5519cf7 100644 --- a/src/plugins/messageActions.ts +++ b/src/plugins/messageActions.ts @@ -1,11 +1,12 @@ import { MessageClicks } from "../api"; import definePlugin from "../utils/types"; -import { find, findByProps } from "../utils/webpack"; +import { find, findByProps } from "../webpack"; export default definePlugin({ name: "MessageQuickActions", description: "Quick Delete, Quick edit", author: "Vendicated", + dependencies: ["MessageClicksApi"], start() { const { deleteMessage, startEditMessage } = findByProps("deleteMessage"); const { can } = findByProps("can", "initialize"); diff --git a/src/plugins/noTrack.ts b/src/plugins/noTrack.ts index 6d3a0ba..642d88c 100644 --- a/src/plugins/noTrack.ts +++ b/src/plugins/noTrack.ts @@ -1,5 +1,5 @@ import definePlugin from "../utils/types"; -import { findByProps } from "../utils/webpack"; +import { findByProps } from "../webpack"; const DO_NOTHING = () => void 0; @@ -7,6 +7,7 @@ export default definePlugin({ name: "NoTrack", description: "Disable Discord's tracking and crash reporting", author: "Vendicated", + required: true, start() { findByProps("getSuperPropertiesBase64", "track").track = DO_NOTHING; findByProps("submitLiveCrashReport").submitLiveCrashReport = DO_NOTHING; diff --git a/src/plugins/settings.ts b/src/plugins/settings.ts index fa214f0..63c36d6 100644 --- a/src/plugins/settings.ts +++ b/src/plugins/settings.ts @@ -5,6 +5,7 @@ export default definePlugin({ name: "Settings", description: "Adds Settings UI and debug info", author: "Vendicated", + required: true, patches: [{ find: "default.versionHash", replacement: [ @@ -28,7 +29,7 @@ export default definePlugin({ }, { find: "Messages.ACTIVITY_SETTINGS", replacement: { - match: /\{section:(.{1,2})\.SectionTypes\.HEADER,label:(.{1,2})\.default\.Messages\.ACTIVITY_SETTINGS\}/, + match: /\{section:(.{1,2})\.SectionTypes\.HEADER,\s*label:(.{1,2})\.default\.Messages\.ACTIVITY_SETTINGS\}/, replace: (m, mod) => `{section:${mod}.SectionTypes.HEADER,label:"Vencord"},` + `{section:"Vencord",label:"Vencord",element:Vencord.Components.Settings},` + |