mirror of
https://codeberg.org/emersion/gamja.git
synced 2025-07-09 11:43:59 -04:00
Implement /kick and KICK handling in buffers
This commit is contained in:
parent
1d983bd142
commit
d34bff9ed6
3 changed files with 37 additions and 0 deletions
16
commands.js
16
commands.js
|
@ -56,6 +56,22 @@ export default {
|
|||
getActiveClient(app).send({ command: "JOIN", params: [channel] });
|
||||
},
|
||||
},
|
||||
"kick": {
|
||||
usage: "<user>",
|
||||
description: "Remove a user from the channel",
|
||||
execute: (app, args) => {
|
||||
var user = args[0];
|
||||
var activeBuffer = app.state.buffers.get(app.state.activeBuffer);
|
||||
if (!activeBuffer || !app.isChannel(activeBuffer.name)) {
|
||||
throw new Error("Not in a channel");
|
||||
}
|
||||
var params = [activeBuffer.name, user];
|
||||
if (args.length > 1) {
|
||||
params.push(args.slice(1).join(" "));
|
||||
}
|
||||
getActiveClient(app).send({ command: "KICK", params });
|
||||
},
|
||||
},
|
||||
"me": {
|
||||
usage: "<action>",
|
||||
description: "Send an action message to the current buffer",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue