This commit is contained in:
Flummi
2018-03-01 07:02:33 +01:00
parent 95d76163e3
commit a225922753
2 changed files with 44 additions and 51 deletions

View File

@@ -6,28 +6,20 @@ import triggers from "./inc/trigger";
import events from "./inc/events";
read().then(() => {
let bot = new wrapper();
const self = {
_trigger: new Map(),
trigger: trigger,
bot: bot
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;
},
bot: new wrapper()
};
triggers.forEach(mod => mod(self));
events.forEach(event => event(self));
})
.catch(err => {
logger.error(`(main) ${err.message}`);
});
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;
}
}).catch(err => logger.error(`(main) ${err.message}`));