mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-12 23:43:42 +01:00
Add /invite command
This commit is contained in:
parent
0473b9ced7
commit
65c2816739
17
commands.js
17
commands.js
@ -134,6 +134,23 @@ export default {
|
|||||||
app.openHelp();
|
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,
|
"j": join,
|
||||||
"join": join,
|
"join": join,
|
||||||
"kick": kick,
|
"kick": kick,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user