mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-25 13:29:29 +01:00
Commands/ChanOp: Group multiple unbans/unmutes together into one command
This commit is contained in:
parent
7b69980eff
commit
afa124e0d3
@ -360,12 +360,11 @@ sub cmd_unban($self, $context) {
|
|||||||
$channel = exists $context->{admin_channel_override} ? $context->{admin_channel_override} : $context->{from};
|
$channel = exists $context->{admin_channel_override} ? $context->{admin_channel_override} : $context->{from};
|
||||||
}
|
}
|
||||||
|
|
||||||
$immediately = 1 if not defined $immediately;
|
|
||||||
|
|
||||||
return "Usage: unban <nick/mask,...> <channel> [false value to use unban queue]" if $channel !~ /^#/;
|
return "Usage: unban <nick/mask,...> <channel> [false value to use unban queue]" if $channel !~ /^#/;
|
||||||
|
|
||||||
my @targets = split /,/, $target;
|
my @targets = split /,/, $target;
|
||||||
$immediately = 0 if @targets > 1;
|
$immediately = 0 if @targets > 1 && not defined $immediately;
|
||||||
|
$immediately //= 1;
|
||||||
|
|
||||||
foreach my $t (@targets) {
|
foreach my $t (@targets) {
|
||||||
if ($t eq '*') {
|
if ($t eq '*') {
|
||||||
@ -386,7 +385,7 @@ sub cmd_unban($self, $context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{pbot}->{banlist}->flush_unban_queue if not $immediately;
|
$self->{pbot}->{banlist}->flush_unban_queue if $immediately;
|
||||||
return "/msg $context->{nick} $target has been unbanned from $channel.";
|
return "/msg $context->{nick} $target has been unbanned from $channel.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,12 +410,12 @@ sub cmd_unmute($self, $context) {
|
|||||||
if (not defined $target) { return "Usage: unmute <nick/mask,...> [channel [false value to use unban queue]]"; }
|
if (not defined $target) { return "Usage: unmute <nick/mask,...> [channel [false value to use unban queue]]"; }
|
||||||
|
|
||||||
$channel = exists $context->{admin_channel_override} ? $context->{admin_channel_override} : $context->{from} if not defined $channel;
|
$channel = exists $context->{admin_channel_override} ? $context->{admin_channel_override} : $context->{from} if not defined $channel;
|
||||||
$immediately = 1 if not defined $immediately;
|
|
||||||
|
|
||||||
return "Usage for /msg: unmute <nick/mask,...> <channel> [false value to use unban queue]" if $channel !~ /^#/;
|
return "Usage for /msg: unmute <nick/mask,...> <channel> [false value to use unban queue]" if $channel !~ /^#/;
|
||||||
|
|
||||||
my @targets = split /,/, $target;
|
my @targets = split /,/, $target;
|
||||||
$immediately = 0 if @targets > 1;
|
$immediately = 0 if @targets > 1 && not defined $immediately;
|
||||||
|
$immediately //= 1;
|
||||||
|
|
||||||
foreach my $t (@targets) {
|
foreach my $t (@targets) {
|
||||||
if ($t eq '*') {
|
if ($t eq '*') {
|
||||||
@ -437,7 +436,7 @@ sub cmd_unmute($self, $context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{pbot}->{banlist}->flush_unban_queue if not $immediately;
|
$self->{pbot}->{banlist}->flush_unban_queue if $immediately;
|
||||||
return "/msg $context->{nick} $target has been unmuted in $channel.";
|
return "/msg $context->{nick} $target has been unmuted in $channel.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user