diff --git a/lib/PBot/Core/Commands/CommandMetadata.pm b/lib/PBot/Core/Commands/CommandMetadata.pm index 0b033330..411ddc4f 100644 --- a/lib/PBot/Core/Commands/CommandMetadata.pm +++ b/lib/PBot/Core/Commands/CommandMetadata.pm @@ -39,7 +39,7 @@ sub cmd_set { return "Usage: cmdset [key [value]]"; } - return $self->{metadata}->set($command, $key, $value); + return $self->{pbot}->{commands}->{metadata}->set($command, $key, $value); } sub cmd_unset { @@ -51,7 +51,7 @@ sub cmd_unset { return "Usage: cmdunset "; } - return $self->{metadata}->unset($command, $key); + return $self->{pbot}->{commands}->{metadata}->unset($command, $key); } 1; diff --git a/lib/PBot/Core/Commands/Help.pm b/lib/PBot/Core/Commands/Help.pm index 216474a9..7aaf5d00 100644 --- a/lib/PBot/Core/Commands/Help.pm +++ b/lib/PBot/Core/Commands/Help.pm @@ -24,7 +24,6 @@ sub new { sub initialize { my ($self, %conf) = @_; - $self->{pbot}->{commands}->register(sub { $self->cmd_help(@_) }, 'help'); } @@ -38,13 +37,13 @@ sub cmd_help { my $keyword = lc $self->{pbot}->{interpreter}->shift_arg($context->{arglist}); # check built-in commands first - if ($self->exists($keyword)) { + if ($self->{pbot}->{commands}->exists($keyword)) { # check for command metadata - if ($self->{metadata}->exists($keyword)) { - my $name = $self->{metadata}->get_key_name($keyword); - my $requires_cap = $self->{metadata}->get_data($keyword, 'requires_cap'); - my $help = $self->{metadata}->get_data($keyword, 'help'); + if ($self->{pbot}->{commands}->{metadata}->exists($keyword)) { + my $name = $self->{pbot}->{commands}->{metadata}->get_key_name($keyword); + my $requires_cap = $self->{pbot}->{commands}->{metadata}->get_data($keyword, 'requires_cap'); + my $help = $self->{pbot}->{commands}->{metadata}->get_data($keyword, 'help'); my $result = "/say $name: ";