mirror of https://github.com/pragma-/pbot.git
Channels: silence warning when no channels set
This commit is contained in:
parent
569463df28
commit
3f74dd1215
|
@ -106,6 +106,8 @@ sub cmd_list {
|
||||||
sub join {
|
sub join {
|
||||||
my ($self, $channels) = @_;
|
my ($self, $channels) = @_;
|
||||||
|
|
||||||
|
return if not $channels;
|
||||||
|
|
||||||
$self->{pbot}->{conn}->join($channels);
|
$self->{pbot}->{conn}->join($channels);
|
||||||
|
|
||||||
foreach my $channel (split /,/, $channels) {
|
foreach my $channel (split /,/, $channels) {
|
||||||
|
@ -134,13 +136,18 @@ sub part {
|
||||||
|
|
||||||
sub autojoin {
|
sub autojoin {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
return if $self->{pbot}->{joined_channels};
|
return if $self->{pbot}->{joined_channels};
|
||||||
|
|
||||||
my $channels;
|
my $channels;
|
||||||
foreach my $channel ($self->{storage}->get_keys) {
|
foreach my $channel ($self->{storage}->get_keys) {
|
||||||
if ($self->{storage}->get_data($channel, 'enabled')) {
|
if ($self->{storage}->get_data($channel, 'enabled')) {
|
||||||
$channels .= $self->{storage}->get_key_name($channel) . ',';
|
$channels .= $self->{storage}->get_key_name($channel) . ',';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return if not $channels;
|
||||||
|
|
||||||
$self->{pbot}->{logger}->log("Joining channels: $channels\n");
|
$self->{pbot}->{logger}->log("Joining channels: $channels\n");
|
||||||
$self->join($channels);
|
$self->join($channels);
|
||||||
$self->{pbot}->{joined_channels} = 1;
|
$self->{pbot}->{joined_channels} = 1;
|
||||||
|
|
Loading…
Reference in New Issue