remove events_bak folder
This commit is contained in:
parent
8f0935ce74
commit
21c1f42aeb
|
@ -1,16 +0,0 @@
|
|||
import logger from "../log";
|
||||
|
||||
const versions = [
|
||||
"AmIRC.1 (8 Bit) for Commodore Amiga 500",
|
||||
"HexChat 0.72 [x86] / Windows 95c [500MHz]"
|
||||
];
|
||||
|
||||
export default self => {
|
||||
self.bot.on("ctcp:version", e => {
|
||||
e.write(`notice ${e.user.nick} :\u0001VERSION ${versions[~~(Math.random() * versions.length)]}\u0001`);
|
||||
});
|
||||
|
||||
self.bot.on("ctcp:ping", e => {
|
||||
e.write(`notice ${e.user.nick} :${e.message}`);
|
||||
});
|
||||
};
|
|
@ -1,6 +0,0 @@
|
|||
import ctcp from "./ctcp";
|
||||
import message from "./message";
|
||||
|
||||
export default [
|
||||
ctcp, message
|
||||
];
|
|
@ -1,51 +0,0 @@
|
|||
import logger from "../log";
|
||||
import { read, cfg } from "../cfg";
|
||||
|
||||
import { getLevel } from "../../inc/admin";
|
||||
|
||||
const parseArgs = (msg) => {
|
||||
let args = msg.trim().split(" ");
|
||||
let cmd = args.shift();
|
||||
return {
|
||||
cmd: cmd.replace(/^(\.|\/|\!)/, ""),
|
||||
args: args
|
||||
};
|
||||
};
|
||||
|
||||
export default self => {
|
||||
self.bot.on("message", e => {
|
||||
for (var [name, trigger] of self._trigger.entries()) {
|
||||
//if (!e.self.me.nickname) {
|
||||
// e.reply("nope, still initialising myself :^)");
|
||||
// break;
|
||||
//}
|
||||
if (!trigger.call.exec(e.message))
|
||||
continue;
|
||||
if (!trigger.clients.includes(e.type))
|
||||
continue;
|
||||
|
||||
let active = false;
|
||||
if (e.type === "irc" && cfg.trigger[e.network + e.channel]) {
|
||||
if (cfg.trigger[e.network + e.channel][trigger.name])
|
||||
active = true;
|
||||
}
|
||||
else
|
||||
active = trigger.active;
|
||||
if (!active)
|
||||
continue;
|
||||
|
||||
if ((e.self.set !== "all" && e.self.set !== trigger.set) && trigger.set !== "all")
|
||||
continue;
|
||||
|
||||
//if (trigger.level > e.user.level.level) {
|
||||
if (trigger.level > getLevel(e.network, e.user)) {
|
||||
e.reply(`no permission, min level ${trigger.level} required`);
|
||||
break;
|
||||
}
|
||||
|
||||
e = Object.assign(e, parseArgs(e.message));
|
||||
trigger.f(e);
|
||||
}
|
||||
logger.info(`${e.network} -> ${e.channel} -> ${e.user.nick}: ${e.message}`);
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user