cuffeo ausgelagert..
This commit is contained in:
14
src/bot.mjs
14
src/bot.mjs
@@ -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}`));
|
||||
})();
|
||||
|
Reference in New Issue
Block a user