summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-01-02 19:11:56 -0500
committerNeil Moore <neil@s-z.org>2012-01-02 19:11:56 -0500
commit7ed5433a8f719115fb9f3f719c10fe9152e171e9 (patch)
treea3e915ce0fd9e0cd3262fab7ae90b9707e45774d
parent12adae54843675e205036a580b80220e5b43a943 (diff)
downloadcrawlbot-7ed5433a8f719115fb9f3f719c10fe9152e171e9.tar.gz
crawlbot-7ed5433a8f719115fb9f3f719c10fe9152e171e9.zip
Add a %bug command.
-rw-r--r--lib/Crawl/Bot/Plugin/Mantis.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Crawl/Bot/Plugin/Mantis.pm b/lib/Crawl/Bot/Plugin/Mantis.pm
index 6c2fe61..e6ff7be 100644
--- a/lib/Crawl/Bot/Plugin/Mantis.pm
+++ b/lib/Crawl/Bot/Plugin/Mantis.pm
@@ -14,6 +14,15 @@ sub item_to_id {
return $id;
}
+sub said {
+ my $self = shift;
+ my ($args) = @_;
+
+ if ($args->{body} =~ /^%bug (\d+)$/) {
+ $self->say_all("https://crawl.develz.org/mantis/view.php?id=$1");
+ }
+}
+
sub tick {
my $self = shift;
$self->each_current_item(sub {