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