mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 04:22:35 +01:00
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 {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user