diff --git a/commands.js b/commands.js index cf75d7c..3dd2645 100644 --- a/commands.js +++ b/commands.js @@ -46,6 +46,23 @@ export default { app.close(activeBuffer.id); }, }, + "deop": { + usage: "", + 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: "", + 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",