mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Add ability to check if a nick is present in any channels
This commit is contained in:
parent
a904fbdccb
commit
f3d84931b1
@ -103,6 +103,19 @@ sub get_channels {
|
||||
return \@channels;
|
||||
}
|
||||
|
||||
sub is_present_any_channel {
|
||||
my ($self, $nick) = @_;
|
||||
|
||||
$nick = lc $nick;
|
||||
|
||||
foreach my $channel (keys %{ $self->{nicklist} }) {
|
||||
if (exists $self->{nicklist}->{$channel}->{$nick}) {
|
||||
return $self->{nicklist}->{$channel}->{$nick}->{nick};
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub is_present {
|
||||
my ($self, $channel, $nick) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user