summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-07-09 09:33:56 -0500
committerNeil Moore <neil@s-z.org>2013-07-09 09:33:56 -0500
commit4fe822f2c6159f1d870e28fd358b6f59efcd73f3 (patch)
tree5145087bed9ad86b196a1d4126ecf117b3f04b9f
parentac42f84040256fe3a5c159d132cbc2053309e684 (diff)
downloadcrawlbot-4fe822f2c6159f1d870e28fd358b6f59efcd73f3.tar.gz
crawlbot-4fe822f2c6159f1d870e28fd358b6f59efcd73f3.zip
Add a %help/%source command with links to source.
Including source for monster and crawl itself, for AGPL compliance.
-rw-r--r--lib/Crawl/Bot/Plugin/Help.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Crawl/Bot/Plugin/Help.pm b/lib/Crawl/Bot/Plugin/Help.pm
new file mode 100644
index 0000000..46f3e42
--- /dev/null
+++ b/lib/Crawl/Bot/Plugin/Help.pm
@@ -0,0 +1,25 @@
+package Crawl::Bot::Plugin::Help;
+use Moose;
+use autodie;
+extends 'Crawl::Bot::Plugin';
+
+sub said {
+ my $self = shift;
+ my ($args) = @_;
+
+ if ($args->{body} =~ /^\%(help|source)/) {
+ my $msg = "http://s-z.org/neil/git/cheibriados.git http://s-z.org/neil/git/monster-trunk.git git://gitorious.org/crawl/crawl.git";
+
+ my %keys = (
+ who => $args->{who},
+ channel => $args->{channel},
+ "body" => $msg
+ );
+ $self->say(%keys);
+ }
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;