From 4fe822f2c6159f1d870e28fd358b6f59efcd73f3 Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Tue, 9 Jul 2013 09:33:56 -0500 Subject: Add a %help/%source command with links to source. Including source for monster and crawl itself, for AGPL compliance. --- lib/Crawl/Bot/Plugin/Help.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/Crawl/Bot/Plugin/Help.pm 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; -- cgit v1.2.3-54-g00ecf