f0ckv2/src/index.mjs

29 lines
852 B
JavaScript
Raw Normal View History

2018-09-02 10:07:40 +00:00
import { logger } from "./inc/log";
2018-09-08 09:21:26 +00:00
import { read, cfg, admins } from "./inc/cfg";
//import { wrapper } from "./inc/wrapper";
import { cuffeo } from "cuffeo";
2018-09-02 10:07:40 +00:00
import triggers from "./inc/trigger";
import events from "./inc/events";
read().then(() => {
const self = {
_trigger: new Map(),
trigger: function trigger(args) {
this.call = args.call;
this.help = args.help || false;
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.f = args.f;
},
2018-09-08 09:21:26 +00:00
bot: new cuffeo(cfg.client, admins)
2018-09-02 10:07:40 +00:00
};
triggers.forEach(mod => {
mod(self);
});
events.forEach(event => event(self));
}).catch(err => logger.error(`(main) ${err.message}`));