3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Add is_active($channel) to determine if $channel is added and enabled

This commit is contained in:
Pragmatic Software 2016-07-01 12:58:29 -07:00
parent 2792a0cb0b
commit bdfd17612c

View File

@ -101,6 +101,18 @@ sub list {
return $result;
}
sub is_active {
my ($self, $channel) = @_;
return exists $self->{channels}->hash->{$channel} && $self->{channels}->hash->{$channel}->{enabled};
}
sub is_active_op {
my ($self, $channel) = @_;
return $self->is_active($channel) && $self->{channels}->hash->{$channel}->{chanop};
}
sub load_channels {
my $self = shift;