mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-11 23:53:03 -04:00
More progress
This commit is contained in:
parent
1709ab61ef
commit
c39ff8f648
15 changed files with 296 additions and 155 deletions
|
@ -1,3 +1,27 @@
|
|||
import plugins from "plugins";
|
||||
import Plugins from "plugins";
|
||||
import Logger from "../utils/logger";
|
||||
import { Patch } from "../utils/types";
|
||||
|
||||
console.log(plugins);
|
||||
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 patch of plugin.patches) {
|
||||
patch.plugin = plugin.name;
|
||||
if (!Array.isArray(patch.replacement)) patch.replacement = [patch.replacement];
|
||||
patches.push(patch);
|
||||
}
|
||||
}
|
||||
|
||||
export function startAll() {
|
||||
for (const plugin of plugins) if (plugin.start) {
|
||||
try {
|
||||
logger.info("Starting plugin", plugin.name);
|
||||
plugin.start();
|
||||
} catch (err) {
|
||||
logger.error("Failed to start plugin", plugin.name, err);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue