1
0
forked from keinBot/cuffeo
This commit is contained in:
Flummi
2018-09-07 19:22:47 +02:00
parent db7e2e9f39
commit 7c8a83fa3c
17 changed files with 643 additions and 0 deletions

21
src/clients/irc/cap.mjs Normal file
View File

@@ -0,0 +1,21 @@
export default client => {
client._cmd.set("CAP", function (msg) { // capkram
switch (msg.params[1]) {
case "LS": // list
this.send(`CAP REQ :${msg.params[2]}`);
break;
case "ACK": // success
this.send("AUTHENTICATE PLAIN");
break;
}
}.bind(client));
client._cmd.set("AUTHENTICATE", function (msg) { // auth
if (msg.params[0].match(/\+/))
this.send(`AUTHENTICATE ${new Buffer(this.username + "\u0000" + this.username + "\u0000" + this.options.password).toString("base64")}`);
}.bind(client));
client._cmd.set("900", function (msg) { // cap end
this.send("CAP END");
}.bind(client));
};