X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Dispatcher.pm;h=8d7ffe9843893ba2768cced2fd149a8becec64c5;hp=5da34bdaf5d9ab976419ff8151ceda3275462261;hb=e8c94cdebefdc428ea92fde6db63f18d3e8399b2;hpb=4f1948e0fe10075464732db5cc2168207c00c7aa diff --git a/Dispatcher.pm b/Dispatcher.pm index 5da34bd..8d7ffe9 100644 --- a/Dispatcher.pm +++ b/Dispatcher.pm @@ -67,7 +67,7 @@ sub load_class { my @subs = eval "$class->meta->get_method_list"; for my $c (@subs){ my $attr = eval "$class->meta->get_method('$c')->attributes"; - if ($attr){ + if (@$attr){ print "Command: $c"; my %c = (channels => ['all']); my @aliases; @@ -110,7 +110,7 @@ sub has_command { my ($self,$command,$channel) = @_; $channel = lc $channel; - return 0 unless exists $self->commands->{$command}; + return 0 unless defined $command && exists $self->commands->{$command}; my $types = Set::Object->new(@{$self->commands->{$command}->type}); my @types = qw/pub/; @@ -146,6 +146,7 @@ sub run_command { } } } + return 1; } 1;