3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-27 13:12:42 +01:00

unban command can now take comma-separated list of targets; can also opt to use unban queue or not

This commit is contained in:
Pragmatic Software 2017-11-08 11:11:43 -08:00
parent 34fee863e0
commit 7e9c116712

View File

@ -106,13 +106,14 @@ sub unban_user {
return "";
}
my ($target, $channel) = split /\s+/, $arguments;
my ($target, $channel, $immediately) = split /\s+/, $arguments;
if(not defined $target) {
return "/msg $nick Usage: unban <mask> [channel]";
}
$channel = $from if not defined $channel;
$immediately = 1 if not defined $immediately;
return "/msg $nick Usage for /msg: unban <nick/mask> <channel>" if $channel !~ /^#/;
@ -120,7 +121,13 @@ sub unban_user {
return "/msg $nick You are not an admin for $channel.";
}
$self->{pbot}->{chanops}->unban_user($target, $channel, 1);
my @targets = split /,/, $target;
$immediately = 0 if @targets > 2;
foreach my $t (@targets) {
$self->{pbot}->{chanops}->unban_user($t, $channel, $immediately);
}
return "/msg $nick $target has been unbanned from $channel.";
}