From 4d888729e52731e5912ad7c4b28f509868bfa920 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 30 May 2020 23:18:49 -0700 Subject: [PATCH] ChanOpCommands: fix "Can't locate object method 'mode'" error --- PBot/ChanOpCommands.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PBot/ChanOpCommands.pm b/PBot/ChanOpCommands.pm index d99a6d76..00ab93c4 100644 --- a/PBot/ChanOpCommands.pm +++ b/PBot/ChanOpCommands.pm @@ -189,21 +189,20 @@ sub generic_mode { $i++; if ($i >= $max_modes) { - my $args = "$channel $mode $list"; - $context->{arglist} = $self->{pbot}->{interpreter}->make_args($args); - $result = $self->mode($channel, $context->{nick}, $context->{user}, $context->{host}, $args, $context); - $mode = $flag; - $list = ''; - $i = 0; + $context->{arguments} = "$channel $mode $list"; + $context->{arglist} = $self->{pbot}->{interpreter}->make_args($context->{arguments}); + $result = $self->cmd_mode($context); + $mode = $flag; + $list = ''; + $i = 0; last if $result ne '' and $result ne 'Done.'; } } } if ($i) { - my $args = "$channel $mode $list"; - $context->{arguments} = $args; - $context->{arglist} = $self->{pbot}->{interpreter}->make_args($args); + $context->{arguments} = "$channel $mode $list"; + $context->{arglist} = $self->{pbot}->{interpreter}->make_args($context->{arguments}); $result = $self->cmd_mode($context); }