Add support for IRCv3 setname

This commit is contained in:
Simon Ser 2021-05-25 20:22:21 +02:00
parent 92535fae24
commit 12a38ace90
3 changed files with 22 additions and 1 deletions

View file

@ -144,6 +144,18 @@ export default {
app.reconnect();
},
},
"setname": {
usage: "<realname>",
description: "Change current realname",
execute: (app, args) => {
var newRealname = args.join(" ");
var client = getActiveClient(app);
if (!client.enabledCaps["setname"]) {
throw new Error("Server doesn't support changing the realname");
}
client.send({ command: "SETNAME", params: [newRealname] });
},
},
"topic": {
usage: "<topic>",
description: "Change the topic of the current channel",