mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-28 18:45:51 -05:00
Add /invite command
This commit is contained in:
parent
0473b9ced7
commit
65c2816739
1 changed files with 17 additions and 0 deletions
17
commands.js
17
commands.js
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue