Add /invite command

This commit is contained in:
Drew DeVault 2021-05-28 12:21:05 -04:00 committed by Simon Ser
parent 0473b9ced7
commit 65c2816739

View file

@ -134,6 +134,23 @@ export default {
app.openHelp();
},
},
"invite": {
usage: "<nick>",
description: "Invites a user to the channel",
execute: (app, args) => {
var nick = args[0];
if (!nick) {
throw new Error("Missing nick");
}
var activeBuffer = app.state.buffers.get(app.state.activeBuffer);
if (!activeBuffer || !app.isChannel(activeBuffer.name)) {
throw new Error("Not in a channel");
}
getActiveClient(app).send({ command: "INVITE", params: [
nick, activeBuffer.name,
]});
},
},
"j": join,
"join": join,
"kick": kick,