mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-25 04:02:37 +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 $arg = 0;
|
||||||
|
|
||||||
my ($new_modes, $new_targets) = ("", "");
|
my ($new_modes, $new_targets) = ("", "");
|
||||||
my $MAX_MODES = 4;
|
my $max_modes = $self->{pbot}->{ircd}->{MODES} // 1;
|
||||||
|
|
||||||
while ($modes =~ m/(.)/g) {
|
while ($modes =~ m/(.)/g) {
|
||||||
my $mode = $1;
|
my $mode = $1;
|
||||||
@ -102,7 +102,7 @@ sub mode {
|
|||||||
$new_targets .= "$self->{pbot}->{nicklist}->{nicklist}->{$channel}->{$n}->{nick} ";
|
$new_targets .= "$self->{pbot}->{nicklist}->{nicklist}->{$channel}->{$n}->{nick} ";
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if ($i == $MAX_MODES) {
|
if ($i == $max_modes) {
|
||||||
$self->{pbot}->{chanops}->add_op_command($channel, "mode $channel $new_modes $new_targets");
|
$self->{pbot}->{chanops}->add_op_command($channel, "mode $channel $new_modes $new_targets");
|
||||||
$new_modes = "";
|
$new_modes = "";
|
||||||
$new_targets = "";
|
$new_targets = "";
|
||||||
@ -115,7 +115,7 @@ sub mode {
|
|||||||
$new_targets .= "$target " if length $target;
|
$new_targets .= "$target " if length $target;
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if ($i == $MAX_MODES) {
|
if ($i == $max_modes) {
|
||||||
$self->{pbot}->{chanops}->add_op_command($channel, "mode $channel $new_modes $new_targets");
|
$self->{pbot}->{chanops}->add_op_command($channel, "mode $channel $new_modes $new_targets");
|
||||||
$new_modes = "";
|
$new_modes = "";
|
||||||
$new_targets = "";
|
$new_targets = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user