mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-25 12:12:34 +01:00
join_channel() can now take a comma-separated list of channels and issue them as one IRC command
This commit is contained in:
parent
f6a99818f0
commit
9cf59888c0
@ -179,18 +179,21 @@ sub mute_user_timed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub join_channel {
|
sub join_channel {
|
||||||
my ($self, $channel) = @_;
|
my ($self, $channels) = @_;
|
||||||
|
|
||||||
$self->{pbot}->{event_dispatcher}->dispatch_event('pbot.join', { channel => $channel });
|
$self->{pbot}->{conn}->join($channels);
|
||||||
$self->{pbot}->{conn}->join($channel);
|
|
||||||
|
|
||||||
delete $self->{is_opped}->{$channel};
|
foreach my $channel (split /,/, $channels) {
|
||||||
delete $self->{op_requested}->{$channel};
|
$self->{pbot}->{event_dispatcher}->dispatch_event('pbot.join', { channel => $channel });
|
||||||
|
|
||||||
if (exists $self->{pbot}->{channels}->{channels}->hash->{$channel}
|
delete $self->{is_opped}->{$channel};
|
||||||
and exists $self->{pbot}->{channels}->{channels}->hash->{$channel}{permop}
|
delete $self->{op_requested}->{$channel};
|
||||||
and $self->{pbot}->{channels}->{channels}->hash->{$channel}{permop}) {
|
|
||||||
$self->gain_ops($channel);
|
if (exists $self->{pbot}->{channels}->{channels}->hash->{$channel}
|
||||||
|
and exists $self->{pbot}->{channels}->{channels}->hash->{$channel}{permop}
|
||||||
|
and $self->{pbot}->{channels}->{channels}->hash->{$channel}{permop}) {
|
||||||
|
$self->gain_ops($channel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user