Channels: silence warning when no channels set

This commit is contained in:
Pragmatic Software 2021-07-13 14:02:14 -07:00
parent 569463df28
commit 3f74dd1215
1 changed files with 7 additions and 0 deletions

View File

@ -106,6 +106,8 @@ sub cmd_list {
sub join {
my ($self, $channels) = @_;
return if not $channels;
$self->{pbot}->{conn}->join($channels);
foreach my $channel (split /,/, $channels) {
@ -134,13 +136,18 @@ sub part {
sub autojoin {
my ($self) = @_;
return if $self->{pbot}->{joined_channels};
my $channels;
foreach my $channel ($self->{storage}->get_keys) {
if ($self->{storage}->get_data($channel, 'enabled')) {
$channels .= $self->{storage}->get_key_name($channel) . ',';
}
}
return if not $channels;
$self->{pbot}->{logger}->log("Joining channels: $channels\n");
$self->join($channels);
$self->{pbot}->{joined_channels} = 1;