This commit is contained in:
Flummi 2017-11-13 21:11:13 +01:00
parent 9babb3b8de
commit e04294816e
2 changed files with 12 additions and 4 deletions

View File

@ -16,16 +16,21 @@ read().then(() => {
args = e.message.substring(3);
var context = {
e: e,
gf: "nogf"
gf: "nogf",
c: clients,
console: {
log: console.log
}
}
try {
var output = safeEval(args, context);
if (typeof output !== undefined && output !== 'undefined' && output) {
let blah = JSON.stringify(output);
if (blah != "Converting circular structure to JSON")
if (blah != "Converting circular structure to JSON") {
e.reply(blah.length > 220 ? `holy fuck, Ausgabe wäre viel zu lang! (${blah.length} Zeichen :DDDDDD)` : blah);
}
}
}
catch (err) {
e.reply(err.message);
}

View File

@ -18,6 +18,7 @@ class irc {
this.username = this.options.username || "test";
this.realname = this.options.realname || "test";
this.channels = this.options.channels || [];
this._recachetime = (10 * 1000); // 10 minutes
this.server = {
motd: "",
me: {},
@ -75,9 +76,10 @@ class irc {
account: tmpuser.account || false,
registered: tmpuser.registered || false,
oper: tmpuser.oper || false,
channels: tmpuser.channels || []
channels: tmpuser.channels || [],
cached: ~~(Date.now() / 1000)
};
this.server.user.set( msg.params[1], tmpuser );
this.server.user.set( msg.params[1].toLowerCase(), tmpuser );
break;
case "319": // Chanlist Todo
let tmpchan = new Map();
@ -119,6 +121,7 @@ class irc {
username: msg.params[2],
hostname: msg.params[3]
});
this.send(`WHOIS ${msg.params[5]}`);
break;
case "315": // who_end
console.log(this.server.channel);