summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-26 22:24:46 -0500
committerdoy <doy@tozt.net>2009-04-26 22:24:46 -0500
commit86233c470263d60ad5aaa2e656a96c3029a54b6b (patch)
tree541a0a32919080bef5e208218c459b85a838d518 /lib/Bot/Games.pm
parent666ae159e66abf14e5ba3774f848f38be5940461 (diff)
downloadbot-games-86233c470263d60ad5aaa2e656a96c3029a54b6b.tar.gz
bot-games-86233c470263d60ad5aaa2e656a96c3029a54b6b.zip
use the format roles
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm20
1 files changed, 3 insertions, 17 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index a1de583..3490a10 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -98,8 +98,9 @@ sub said {
$self->$say("Game $game_name hasn't started yet!");
return;
}
- $self->$say(scalar $method_meta->execute($game, $arg,
- {player => $args->{who}}));
+ my $body = $method_meta->execute($game, $arg,
+ {player => $args->{who}});
+ $self->$say($body, formatter => $method_meta->formatter);
}
else {
$self->$say("Unknown command $action for game $game_name");
@@ -152,21 +153,6 @@ sub find_game {
return;
}
-sub _format {
- my $self = shift;
- my ($to_print) = @_;
- if (blessed $to_print) {
- $to_print = "$to_print";
- }
- elsif (ref($to_print) && ref($to_print) eq 'ARRAY') {
- $to_print = join ', ', @$to_print;
- }
- elsif (!$to_print) {
- $to_print = 'false';
- }
- return $to_print;
-}
-
sub _get_command {
my ($game, $action) = @_;
my $method_meta = $game->meta->find_method_by_name($action);