mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-19 10:29:30 +01:00
ChanOpCommands: mode
command: use MODES=x ircd mapping for max modes per command
This commit is contained in:
parent
c9391d7829
commit
b6839cd33f
@ -73,7 +73,7 @@ sub mode {
|
||||
my $arg = 0;
|
||||
|
||||
my ($new_modes, $new_targets) = ("", "");
|
||||
my $MAX_MODES = 4;
|
||||
my $max_modes = $self->{pbot}->{ircd}->{MODES} // 1;
|
||||
|
||||
while ($modes =~ m/(.)/g) {
|
||||
my $mode = $1;
|
||||
@ -102,7 +102,7 @@ sub mode {
|
||||
$new_targets .= "$self->{pbot}->{nicklist}->{nicklist}->{$channel}->{$n}->{nick} ";
|
||||
$i++;
|
||||
|
||||
if ($i == $MAX_MODES) {
|
||||
if ($i == $max_modes) {
|
||||
$self->{pbot}->{chanops}->add_op_command($channel, "mode $channel $new_modes $new_targets");
|
||||
$new_modes = "";
|
||||
$new_targets = "";
|
||||
@ -115,7 +115,7 @@ sub mode {
|
||||
$new_targets .= "$target " if length $target;
|
||||
$i++;
|
||||
|
||||
if ($i == $MAX_MODES) {
|
||||
if ($i == $max_modes) {
|
||||
$self->{pbot}->{chanops}->add_op_command($channel, "mode $channel $new_modes $new_targets");
|
||||
$new_modes = "";
|
||||
$new_targets = "";
|
||||
|
Loading…
Reference in New Issue
Block a user