summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-25 22:02:52 -0500
committerdoy <doy@tozt.net>2009-01-25 22:02:52 -0500
commit945ae6a879fc543d9e763a6033807dfb7bbd5d0b (patch)
treeaf021c223dd2b275a932acb83c8f9638a7129d7b /lib/Bot/Games.pm
parent253ac0f17cef39ca01d6dbe1fda04f3e2480b151 (diff)
downloadbot-games-945ae6a879fc543d9e763a6033807dfb7bbd5d0b.tar.gz
bot-games-945ae6a879fc543d9e763a6033807dfb7bbd5d0b.zip
add @games to list available games
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index cc412ef..0c19d4b 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -61,6 +61,7 @@ sub said {
return if $args->{channel} eq 'msg';
return unless $args->{body} =~ /^$prefix(\w+)(?:\s+(.*))?/;
my ($game_name, $action) = ($1, $2);
+ return $self->game_list if $game_name eq 'games';
return unless $self->valid_game($game_name);
my $output;
@@ -125,6 +126,12 @@ sub game_package {
return 'Bot::Games::Game::' . ucfirst($name);
}
+sub game_list {
+ my $self = shift;
+ return join ' ', map { s/Bot::Games::Game:://; $self->prefix . lc }
+ $self->games;
+}
+
sub _format {
my $self = shift;
my ($to_print) = @_;