3
0
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:
Pragmatic Software 2017-08-12 01:28:23 -07:00
parent a904fbdccb
commit f3d84931b1

View File

@ -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) = @_;