3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-26 20:52:37 +01:00

NickList: add get_nicks() function

This commit is contained in:
Pragmatic Software 2020-02-06 10:47:19 -08:00
parent 2de9ad516f
commit d9aa585949

View File

@ -124,6 +124,17 @@ sub get_channels {
return \@channels;
}
sub get_nicks {
my ($self, $channel) = @_;
$channel = lc $channel;
my @nicks;
return @nicks if not exists $self->{nicklist}->{$channel};
foreach my $nick (keys %{ $self->{nicklist}->{$channel} }) {
push @nicks, $self->{nicklist}->{$channel}->{$nick}->{nick};
}
return @nicks;
}
sub set_meta {
my ($self, $channel, $nick, $key, $value) = @_;