3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01: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; 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 { sub load_channels {
my $self = shift; my $self = shift;