mirror of
https://github.com/pragma-/pbot.git
synced 2025-04-14 03:48:03 +02:00
Can now kick comma-separated nicks
This commit is contained in:
parent
7b4d9cc4cc
commit
8997534ce6
@ -250,22 +250,31 @@ sub kick_user {
|
|||||||
$channel = $1;
|
$channel = $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (not $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host")) {
|
||||||
|
return "/msg $nick You are not an admin for $channel.";
|
||||||
|
}
|
||||||
|
|
||||||
|
my @insults;
|
||||||
if (not length $reason) {
|
if (not length $reason) {
|
||||||
if (open my $fh, '<', $self->{pbot}->{registry}->get_value('general', 'module_dir') . '/insults.txt') {
|
if (open my $fh, '<', $self->{pbot}->{registry}->get_value('general', 'module_dir') . '/insults.txt') {
|
||||||
my @insults = <$fh>;
|
@insults = <$fh>;
|
||||||
close $fh;
|
close $fh;
|
||||||
$reason = $insults[rand @insults];
|
$reason = $insults[rand @insults];
|
||||||
chomp $reason;
|
$reason =~ s/\s+$//;
|
||||||
} else {
|
} else {
|
||||||
$reason = 'Bye!';
|
$reason = 'Bye!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host")) {
|
my @nicks = split /,/, $victim;
|
||||||
return "/msg $nick You are not an admin for $channel.";
|
foreach my $n (@nicks) {
|
||||||
|
$self->{pbot}->{chanops}->add_op_command($channel, "kick $channel $n $reason");
|
||||||
|
if (@insults) {
|
||||||
|
$reason = $insults[rand @insults];
|
||||||
|
$reason =~ s/\s+$//;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{pbot}->{chanops}->add_op_command($channel, "kick $channel $victim $reason");
|
|
||||||
$self->{pbot}->{chanops}->gain_ops($channel);
|
$self->{pbot}->{chanops}->gain_ops($channel);
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user