This commit is contained in:
Flummi 2018-08-24 23:27:44 +02:00
parent 92f4f4532d
commit 2b731c211c
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,5 @@
export default client => { export default client => {
client._cmd.set("JOIN", function (msg) { // join client._cmd.set("JOIN", function (msg) { // join
//this.send(`WHO ${msg.params[0]}`); this.send(`WHO ${msg.params[0]}`);
}.bind(client)); }.bind(client));
}; };

View File

@ -1,3 +1,6 @@
const max = 400;
let whois = [];
export default client => { export default client => {
client._cmd.set("352", function (msg) { // who_entry client._cmd.set("352", function (msg) { // who_entry
if (!this.server.channel[msg.params[1]]) if (!this.server.channel[msg.params[1]])
@ -7,10 +10,18 @@ export default client => {
username: msg.params[2], username: msg.params[2],
hostname: msg.params[3] hostname: msg.params[3]
}); });
this.whois(msg.params[5]); whois.push(msg.params[5]);
}.bind(client)); }.bind(client));
client._cmd.set("315", function (msg) { // who_end client._cmd.set("315", function (msg) { // who_end
// this.whois(whois.reduce((a, b) => {
a += `${b},`;
if(a.length >= max) {
this.whois(a.slice(0, -1));
a = "";
}
return a;
}, "").slice(0, -1));
whois = [];
}.bind(client)); }.bind(client));
}; };