From f45b51d981fad9185d9bc11b9d281e165871995a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 14 Apr 2022 10:53:35 +0200 Subject: [PATCH] commands: fix TypeError in kickban The ban variable was undefined. --- commands.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/commands.js b/commands.js index 93e48dd..0fa4e46 100644 --- a/commands.js +++ b/commands.js @@ -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) { // TODO: Handle several users at once let nick = args[0]; @@ -108,21 +124,7 @@ export default { getActiveClient(app).send({command: "AWAY", params}); }, }, - "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"); - } - }, - }, + "ban": ban, "buffer": { usage: "", description: "Switch to a buffer",