BetterDiscordApp-v2/client/src/modules/modulemanager.js

35 lines
930 B
JavaScript
Raw Normal View History

2018-02-01 03:36:47 +01:00
/**
* BetterDiscord Module Manager
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks
* All rights reserved.
* https://betterdiscord.net
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*Module Manager initializes all modules when everything is ready*/
import { Events } from 'modules';
import { ProfileBadges } from 'ui';
export default class {
static get modules() {
2018-02-01 04:00:28 +01:00
return this._modules ? this._modules : (this._modules = [
new ProfileBadges()
]);
2018-02-01 03:36:47 +01:00
}
static initModules() {
for (let module of this.modules) {
try {
if (module.init && module.init instanceof Function) module.init();
} catch (err) {
console.log(`Failed to initialize module: ${err}`);
}
}
}
}