From 324fb9023ef07c074f1abd9cc8e52e08616cbb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taavi=20V=C3=A4=C3=A4n=C3=A4nen?= Date: Thu, 18 Nov 2021 12:00:40 +0200 Subject: [PATCH] Add /kickban This commit adds a new command, /kickban, that is a combination of /kick and /ban: it kicks the specific user from the channel and then sets the +b mode to ban the user from the channel. --- client/components/Windows/Help.vue | 14 +++++++++++++- src/plugins/inputs/ban.js | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/components/Windows/Help.vue b/client/components/Windows/Help.vue index 19c07aa0..ca13ccfa 100644 --- a/client/components/Windows/Help.vue +++ b/client/components/Windows/Help.vue @@ -583,13 +583,25 @@
- /kick nick + /kick nick [reason]

Kick a user from the current channel.

+
+
+ /kickban nick [reason] +
+
+

+ Kick and ban (+b) a user from the current channel. Unlike + /ban, only nicknames (and not host masks) can be used. +

+
+
+
/list diff --git a/src/plugins/inputs/ban.js b/src/plugins/inputs/ban.js index 9cb66cee..07f3f646 100644 --- a/src/plugins/inputs/ban.js +++ b/src/plugins/inputs/ban.js @@ -3,7 +3,7 @@ const Chan = require("../../models/chan"); const Msg = require("../../models/msg"); -exports.commands = ["ban", "unban", "banlist"]; +exports.commands = ["ban", "unban", "banlist", "kickban"]; exports.input = function ({irc}, chan, cmd, args) { if (chan.type !== Chan.Type.CHANNEL) { @@ -33,6 +33,9 @@ exports.input = function ({irc}, chan, cmd, args) { } switch (cmd) { + case "kickban": + irc.raw("KICK", chan.name, args[0], args.slice(1).join(" ")); + // fall through case "ban": irc.ban(chan.name, args[0]); break;