summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-06-25 15:41:38 -0500
committerNeil Moore <neil@s-z.org>2013-06-25 16:36:01 -0500
commite8e07e2500b51ba65faf4a207bd4965e11d96d4d (patch)
tree383503c61086b47dd5b9520cd865045dc91aaa31
parent5154444c37381d71db1d2da8a9bc61142cf6ac12 (diff)
downloadcrawlbot-e8e07e2500b51ba65faf4a207bd4965e11d96d4d.tar.gz
crawlbot-e8e07e2500b51ba65faf4a207bd4965e11d96d4d.zip
Add say_main method to say something in the main channel only.
-rw-r--r--lib/Crawl/Bot.pm9
-rw-r--r--lib/Crawl/Bot/Plugin.pm2
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/Crawl/Bot.pm b/lib/Crawl/Bot.pm
index 135bef7..d78b259 100644
--- a/lib/Crawl/Bot.pm
+++ b/lib/Crawl/Bot.pm
@@ -106,4 +106,13 @@ sub say_all {
) for $self->channels;
}
+sub say_main {
+ my $self = shift;
+ my ($message) = @_;
+ $self->say(
+ channel => ($self->channels)[0],
+ body => $message,
+ );
+}
+
1;
diff --git a/lib/Crawl/Bot/Plugin.pm b/lib/Crawl/Bot/Plugin.pm
index 0661f24..8869fca 100644
--- a/lib/Crawl/Bot/Plugin.pm
+++ b/lib/Crawl/Bot/Plugin.pm
@@ -6,7 +6,7 @@ has bot => (
isa => 'Crawl::Bot',
required => 1,
weak_ref => 1,
- handles => [qw(emote say say_all data_dir)],
+ handles => [qw(emote say say_all say_main data_dir)],
);
# not all plugins require implementations here