uff
This commit is contained in:
parent
d0821b3553
commit
19782dd6f8
|
@ -18,12 +18,10 @@ export default class cuffeo extends EventEmitter {
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
async loadLibs() {
|
async loadLibs() {
|
||||||
const _libs = {};
|
return (await (Promise.all((await fs.promises.readdir(`${__dirname}/clients`)).filter(f => f.endsWith(".mjs")).map(async client => {
|
||||||
for (const client of (await fs.promises.readdir(`${__dirname}/clients`)).filter(f => f.endsWith(".mjs"))) {
|
const lib = (await import(`./clients/${client}`)).default;
|
||||||
const lib = await import(`./clients/${client}`);
|
return { [lib.name]: lib };
|
||||||
_libs[lib.default.name] = lib.default;
|
})))).reduce((a, b) => ({ ...a, ...b }));
|
||||||
}
|
|
||||||
return _libs;
|
|
||||||
}
|
}
|
||||||
async registerClients(cfg) {
|
async registerClients(cfg) {
|
||||||
return cfg.filter(e => e.enabled).map(async srv => {
|
return cfg.filter(e => e.enabled).map(async srv => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user