diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/index.ts | 57 | ||||
-rw-r--r-- | src/plugins/settings.ts | 3 |
2 files changed, 31 insertions, 29 deletions
diff --git a/src/plugins/index.ts b/src/plugins/index.ts index e4d0775..e03c588 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -23,37 +23,38 @@ export function startAllPlugins() { } export function startPlugin(p: Plugin) { - if (p.start) { - logger.info("Starting plugin", p.name); - if (p.started) { - logger.warn(`${p.name} already started`); - return false; - } - try { - p.start(); - p.started = true; - return true; - } catch (err: any) { - logger.error(`Failed to start ${p.name}\n`, err); - return false; - } + if (!p.start) return true; + + logger.info("Starting plugin", p.name); + if (p.started) { + logger.warn(`${p.name} already started`); + return false; + } + + try { + p.start(); + p.started = true; + return true; + } catch (err: any) { + logger.error(`Failed to start ${p.name}\n`, err); + return false; } } export function stopPlugin(p: Plugin) { - if (p.stop) { - logger.info("Stopping plugin", p.name); - if (!p.started) { - logger.warn(`${p.name} already stopped / never started`); - return false; - } - try { - p.stop(); - p.started = false; - return true; - } catch (err: any) { - logger.error(`Failed to stop ${p.name}\n`, err); - return false; - } + if (!p.stop) return true; + + logger.info("Stopping plugin", p.name); + if (!p.started) { + logger.warn(`${p.name} already stopped / never started`); + return false; + } + try { + p.stop(); + p.started = false; + return true; + } catch (err: any) { + logger.error(`Failed to stop ${p.name}\n`, err); + return false; } } diff --git a/src/plugins/settings.ts b/src/plugins/settings.ts index afefa91..2ed85e6 100644 --- a/src/plugins/settings.ts +++ b/src/plugins/settings.ts @@ -27,7 +27,8 @@ export default definePlugin({ match: /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/, replace: (m, mod) => `{section:${mod}.ID.HEADER,label:"Vencord"},` + - `{section:"Vencord",label:"Vencord",element:Vencord.Components.Settings},` + + `{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},` + + `{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater},` + `{section:${mod}.ID.DIVIDER},${m}` } |