diff options
-rw-r--r-- | lib/Bot/Games/OO/Game.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Bot/Games/OO/Game.pm b/lib/Bot/Games/OO/Game.pm index 972584e..3921a0d 100644 --- a/lib/Bot/Games/OO/Game.pm +++ b/lib/Bot/Games/OO/Game.pm @@ -3,7 +3,11 @@ use Bot::Games::OO (); sub command { my $class = shift; - my ($name, $code, %args) = @_; + my $name = shift; + my $code; + $code = shift if ref($_[0]) eq 'CODE'; + my %args = @_; + my $method_meta = $class->meta->get_method($name); my $superclass = Moose::blessed($method_meta) || 'Moose::Meta::Method'; my @method_metaclass_roles = ('Bot::Games::Trait::Method::Command'); |