diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-11-26 00:51:23 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-11-26 00:51:23 -0600 |
commit | 0bad6682d0c6a747fd10e38465939c79930238d0 (patch) | |
tree | 7c9895b976cfce1969ede95e77c5783cca5f7768 | |
parent | b2c70c0cba3338f698b66e334e293c14bfd68cf0 (diff) | |
download | crawlbot-0bad6682d0c6a747fd10e38465939c79930238d0.tar.gz crawlbot-0bad6682d0c6a747fd10e38465939c79930238d0.zip |
fix b::bb config a bit
-rw-r--r-- | bin/run | 2 | ||||
-rw-r--r-- | lib/Crawl/Bot.pm | 12 |
2 files changed, 10 insertions, 4 deletions
@@ -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; |