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

View File

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