1
0
forked from keinBot/cuffeo

irgendwas mit overhaul

This commit is contained in:
Flummi
2019-08-22 22:05:18 +00:00
parent acf7ac3d49
commit 0d45670ae4
14 changed files with 132 additions and 174 deletions

View File

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