From 31f56db58c77fa4669fca406a3cd471e9b68f3dd Mon Sep 17 00:00:00 2001 From: doy Date: Sun, 26 Apr 2009 22:55:16 -0500 Subject: don't try to apply a formatter if the method metaclass doesn't do the role --- lib/Bot/Games.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Bot/Games.pm') diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm index 3490a10..420d658 100644 --- a/lib/Bot/Games.pm +++ b/lib/Bot/Games.pm @@ -100,7 +100,8 @@ sub said { } my $body = $method_meta->execute($game, $arg, {player => $args->{who}}); - $self->$say($body, formatter => $method_meta->formatter); + my @extra_args = $method_meta->does_role('Bot::Games::Trait::Method::Formatted') ? (formatter => $method_meta->formatter) : (); + $self->$say($body, @extra_args); } else { $self->$say("Unknown command $action for game $game_name"); -- cgit v1.2.3-54-g00ecf