From 65c28167398c1967f25913c544cfc34d55ff5a5f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 28 May 2021 12:21:05 -0400 Subject: [PATCH] Add /invite command --- commands.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/commands.js b/commands.js index f112816..1b507c2 100644 --- a/commands.js +++ b/commands.js @@ -134,6 +134,23 @@ export default { app.openHelp(); }, }, + "invite": { + usage: "", + 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,