commands: fix TypeError in kickban

The ban variable was undefined.
This commit is contained in:
Simon Ser 2022-04-14 10:53:35 +02:00
parent 73db1a888e
commit f45b51d981

View File

@ -83,6 +83,22 @@ const kick = {
}, },
}; };
const ban = {
usage: "[nick]",
description: "Ban a user from the channel, or display the current ban list",
execute: (app, args) => {
if (args.length == 0) {
let activeChannel = getActiveChannel(app);
getActiveClient(app).send({
command: "MODE",
params: [activeChannel, "+b"],
});
} else {
return setUserHostMode(app, args, "+b");
}
},
};
function givemode(app, args, mode) { function givemode(app, args, mode) {
// TODO: Handle several users at once // TODO: Handle several users at once
let nick = args[0]; let nick = args[0];
@ -108,21 +124,7 @@ export default {
getActiveClient(app).send({command: "AWAY", params}); getActiveClient(app).send({command: "AWAY", params});
}, },
}, },
"ban": { "ban": ban,
usage: "[nick]",
description: "Ban a user from the channel, or display the current ban list",
execute: (app, args) => {
if (args.length == 0) {
let activeChannel = getActiveChannel(app);
getActiveClient(app).send({
command: "MODE",
params: [activeChannel, "+b"],
});
} else {
return setUserHostMode(app, args, "+b");
}
},
},
"buffer": { "buffer": {
usage: "<name>", usage: "<name>",
description: "Switch to a buffer", description: "Switch to a buffer",