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 => {
client._cmd.set("JOIN", function (msg) { // join
//this.send(`WHO ${msg.params[0]}`);
this.send(`WHO ${msg.params[0]}`);
}.bind(client));
};

View File

@ -1,3 +1,6 @@
const max = 400;
let whois = [];
export default client => {
client._cmd.set("352", function (msg) { // who_entry
if (!this.server.channel[msg.params[1]])
@ -7,10 +10,18 @@ export default client => {
username: msg.params[2],
hostname: msg.params[3]
});
this.whois(msg.params[5]);
whois.push(msg.params[5]);
}.bind(client));
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));
};