cuffeo ausgelagert..

This commit is contained in:
Flummi
2019-08-17 11:54:50 +00:00
parent 05d42650ec
commit c0ef557f72
31 changed files with 22 additions and 1021 deletions

View File

@@ -1,11 +1,15 @@
import { logger } from "./inc/log";
import { read, cfg } from "./inc/cfg";
import { wrapper } from "./inc/wrapper";
import { default as config } from "../cfg/config.json";
import triggers from "./inc/trigger";
import events from "./inc/events";
read().then(() => {
import cuffeo from "cuffeo";
(async () => {
await read(); // read and parse config from database
const self = {
_trigger: new Map(),
trigger: function trigger(args) {
@@ -14,12 +18,12 @@ read().then(() => {
this.level = args.level || 0;
this.active = args.hasOwnProperty("active") ? args.active : true;
this.set = args.set || "all"; // uwe, nxy, f0ck, all
this.clients = args.clients || ["irc", "tg", "discord"];
this.clients = args.clients || [ "irc", "tg" ];
this.f = args.f;
},
bot: new wrapper()
bot: new cuffeo(config.clients)
};
triggers.forEach(mod => mod(self));
events.forEach(event => event(self));
}).catch(err => logger.error(`(main) ${err.message}`));
})();