Merge pull request #4361 from supertassu/kickban

This commit is contained in:
Max Leiter 2021-12-01 18:25:09 -08:00 committed by GitHub
commit 304d207820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -583,13 +583,25 @@
<div class="help-item"> <div class="help-item">
<div class="subject"> <div class="subject">
<code>/kick nick</code> <code>/kick nick [reason]</code>
</div> </div>
<div class="description"> <div class="description">
<p>Kick a user from the current channel.</p> <p>Kick a user from the current channel.</p>
</div> </div>
</div> </div>
<div class="help-item">
<div class="subject">
<code>/kickban nick [reason]</code>
</div>
<div class="description">
<p>
Kick and ban (<code>+b</code>) a user from the current channel. Unlike
<code>/ban</code>, only nicknames (and not host masks) can be used.
</p>
</div>
</div>
<div class="help-item"> <div class="help-item">
<div class="subject"> <div class="subject">
<code>/list</code> <code>/list</code>

View File

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