Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2021-03-05 13:31:42 +01:00
parent aeefa8fbd8
commit b52c7281f3
1 changed files with 5 additions and 2 deletions

View File

@ -7919,7 +7919,7 @@ module.exports = (_ => {
let pluginName = pluginQueue.shift(); let pluginName = pluginQueue.shift();
if (pluginName) BDFDB.TimeUtils.timeout(_ => BDFDB.BDUtils.reloadPlugin(pluginName)); if (pluginName) BDFDB.TimeUtils.timeout(_ => BDFDB.BDUtils.reloadPlugin(pluginName));
} }
}, "Could not initiate library!", config.name)); }, "Could not initiate library!"));
}); });
}; };
loadLibrary(true); loadLibrary(true);
@ -7931,11 +7931,14 @@ module.exports = (_ => {
getDescription () {return config.info.description;} getDescription () {return config.info.description;}
load () { load () {
this.loaded = true;
libraryInstance = this; libraryInstance = this;
Object.assign(this, config.info, BDFDB.ObjectUtils.exclude(config, "info")); Object.assign(this, config.info, BDFDB.ObjectUtils.exclude(config, "info"));
if (!BDFDB.BDUtils.isPluginEnabled(config.info.name)) BDFDB.BDUtils.enablePlugin(config.info.name); if (!BDFDB.BDUtils.isPluginEnabled(config.info.name)) BDFDB.BDUtils.enablePlugin(config.info.name);
} }
start () {} start () {
if (!this.loaded) this.load();
}
stop () { stop () {
if (!BDFDB.BDUtils.isPluginEnabled(config.info.name)) BDFDB.BDUtils.enablePlugin(config.info.name); if (!BDFDB.BDUtils.isPluginEnabled(config.info.name)) BDFDB.BDUtils.enablePlugin(config.info.name);
} }