outsourced :⁾

This commit is contained in:
Flummi
2018-09-08 20:38:06 +02:00
parent 4069b416da
commit 9d440644bc
16 changed files with 0 additions and 629 deletions

View File

@ -1,41 +0,0 @@
import { cfg } from "./cfg";
import { irc as irclib } from "../clients/irc";
import { tg as tglib } from "../clients/tg";
import EventEmitter from "events";
const clients = [];
const wrapper = class wrapper extends EventEmitter {
constructor() {
super();
for (let srv in cfg.client) {
if(cfg.client[srv].val.enabled) {
switch (cfg.client[srv].val.type) {
case "irc":
clients.push({
name: cfg.client[srv].val.network,
type: "irc",
client: new irclib(cfg.client[srv].val)
});
break;
case "tg":
clients.push({
name: "tg",
type: "tg",
client: new tglib(cfg.client[srv].val)
});
break;
}
}
}
clients.forEach(client => {
client.client.on("data", e => {
this.emit(e[0], e[1]);
});
});
}
};
export { wrapper, clients };