mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-25 00:38:12 -05:00
Add /op, /deop commands
This commit is contained in:
parent
f0a532dbd6
commit
f5debac388
1 changed files with 34 additions and 0 deletions
34
commands.js
34
commands.js
|
@ -46,6 +46,23 @@ export default {
|
|||
app.close(activeBuffer.id);
|
||||
},
|
||||
},
|
||||
"deop": {
|
||||
usage: "<nick>",
|
||||
description: "Removes operator status for a user on this 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: "MODE", params: [
|
||||
activeBuffer.name, "-o", user,
|
||||
]});
|
||||
},
|
||||
},
|
||||
"disconnect": {
|
||||
description: "Disconnect from the server",
|
||||
execute: (app, args) => {
|
||||
|
@ -130,6 +147,23 @@ export default {
|
|||
getActiveClient(app).send({ command: "NOTICE", params: [target, text] });
|
||||
},
|
||||
},
|
||||
"op": {
|
||||
usage: "<nick>",
|
||||
description: "Gives a user operator status on this 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: "MODE", params: [
|
||||
activeBuffer.name, "+o", nick,
|
||||
]});
|
||||
},
|
||||
},
|
||||
"part": {
|
||||
usage: "[reason]",
|
||||
description: "Leave a channel",
|
||||
|
|
Loading…
Reference in a new issue