From e8e07e2500b51ba65faf4a207bd4965e11d96d4d Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Tue, 25 Jun 2013 15:41:38 -0500 Subject: Add say_main method to say something in the main channel only. --- lib/Crawl/Bot.pm | 9 +++++++++ lib/Crawl/Bot/Plugin.pm | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-54-g00ecf