summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-26 22:55:16 -0500
committerdoy <doy@tozt.net>2009-04-26 22:55:16 -0500
commit31f56db58c77fa4669fca406a3cd471e9b68f3dd (patch)
tree523efbe083fc1d50c293044e2d86df4812d72e11
parent4671d44db2cd128f64cd0607c0fce2daaa291880 (diff)
downloadbot-games-31f56db58c77fa4669fca406a3cd471e9b68f3dd.tar.gz
bot-games-31f56db58c77fa4669fca406a3cd471e9b68f3dd.zip
don't try to apply a formatter if the method metaclass doesn't do the role
-rw-r--r--lib/Bot/Games.pm3
1 files changed, 2 insertions, 1 deletions
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");