summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/run2
-rw-r--r--lib/Crawl/Bot.pm12
2 files changed, 10 insertions, 4 deletions
diff --git a/bin/run b/bin/run
index 2555c09..5ce0f74 100644
--- a/bin/run
+++ b/bin/run
@@ -8,6 +8,4 @@ Crawl::Bot->new(
server => 'irc.freenode.net',
channels => ['##crawl-dev'],
nick => 'crawl-dev',
- username => 'crawl-dev',
- name => 'crawl-dev',
)->run;
diff --git a/lib/Crawl/Bot.pm b/lib/Crawl/Bot.pm
index e6a5e15..ccaa29e 100644
--- a/lib/Crawl/Bot.pm
+++ b/lib/Crawl/Bot.pm
@@ -6,6 +6,14 @@ extends 'Bot::BasicBot';
use autodie;
use XML::RAI;
+has [qw(username name)] => (
+ # don't need (or want) accessors, just want to initialize the hash slot
+ # for B::BB to use
+ is => 'bare',
+ isa => 'Str',
+ default => sub { shift->nick },
+);
+
has rss_feed => (
is => 'ro',
isa => 'Str',
@@ -91,9 +99,9 @@ sub tick {
return if $self->has_item($id);
warn "New issue! ($id)";
$self->say(
- channel => '##crawl-dev',
+ channel => $_,
body => $item->title . ' (' . $item->link . ')'
- );
+ ) for $self->channels;
$self->add_item($id);
});
$self->save_cache;