remove fsimport
This commit is contained in:
parent
6d5b33bed4
commit
e7b8f0b456
10
src/bot.mjs
10
src/bot.mjs
@ -1,7 +1,6 @@
|
||||
import { logger } from "./inc/log";
|
||||
import { read, cfg } from "./inc/cfg";
|
||||
import { wrapper } from "./inc/wrapper";
|
||||
import fs from "fs";
|
||||
|
||||
import triggers from "./inc/trigger/main";
|
||||
|
||||
@ -13,19 +12,12 @@ read().then(() => {
|
||||
trigger: trigger
|
||||
};
|
||||
|
||||
/*fs.readdirSync(`${__dirname}/inc/trigger/`).forEach(file => {
|
||||
if(file.substr(-3, 3) === ".js") {
|
||||
logger.info(`(main) loading trigger: ${file}`);
|
||||
require(`${__dirname}/inc/trigger/${file}`)(self);
|
||||
}
|
||||
});*/
|
||||
|
||||
triggers.forEach((mod, i) => {
|
||||
logger.info(`(main) loading trigger: ${i}`)
|
||||
mod(self);
|
||||
});
|
||||
|
||||
bot.on("message", e => { // Todo: eventhandler
|
||||
bot.on("message", e => {
|
||||
for (var [name, trigger] of self._trigger.entries()) {
|
||||
if (!trigger.call.exec(e.message))
|
||||
continue;
|
||||
|
@ -6,8 +6,6 @@ import modules from "./irc/main";
|
||||
import net from "net";
|
||||
import tls from "tls";
|
||||
import EventEmitter from "events";
|
||||
import util from "util";
|
||||
import fs from "fs";
|
||||
|
||||
const colors = {
|
||||
red: "\x0304$1\x0304",
|
||||
@ -21,9 +19,9 @@ const replaceColor = (match, color, text) => {
|
||||
return text;
|
||||
};
|
||||
|
||||
export class irc {
|
||||
export class irc extends EventEmitter {
|
||||
constructor(options) {
|
||||
EventEmitter.call(this);
|
||||
super();
|
||||
this.options = options || {};
|
||||
this.options.channels = this.options.channels || [];
|
||||
this.options.host = this.options.host || "127.0.0.1";
|
||||
@ -161,7 +159,6 @@ export class irc {
|
||||
;
|
||||
}
|
||||
}
|
||||
util.inherits(irc, EventEmitter);
|
||||
|
||||
Map.prototype.hasi = function(val) {
|
||||
for (let [key] of this)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { logger } from "../log.mjs";
|
||||
import { getLevel } from "../admin.mjs";
|
||||
import { spurdo } from "../spurdo.mjs";
|
||||
import { logger } from "../log";
|
||||
import { getLevel } from "../admin";
|
||||
import { spurdo } from "../spurdo";
|
||||
|
||||
import rp from "request-promise";
|
||||
import EventEmitter from "events";
|
||||
|
Loading…
Reference in New Issue
Block a user